firestring_strdup(3)

firestring_strdup3

Strdup(3) with internal result checking

Usage

#include <firestring.h>
-lfirestring

char *firestring_strdup(const char * const input)

Overview

firestring_strdup() acts exactly like strdup(3) except that it detects malloc failures, prints an error and exit(3) with exit status EXIT_FAILURE. In most programs, malloc failures are unrecoverable, and this is the preferred behaviour.

Return value

If firestring_strdup() returns, it always returns a copy of the string input. It never returns NULL.

Releases

Unchanged in 6 releases since Debian 3.1 (Sarge).

  1. 3.1–8

Author

Ian Gulliver <[email protected]>

From libfirestring-dev 0.9.12-8 in Debian 8 (Jessie). Parsed by carta from the page's man source.