return (0);
} /* }}} int lcc_set_errno */
-/* lcc_strdup: Since `strdup' is an XSI extension, we provide our own version
- * here. */
-__attribute__((malloc, nonnull (1)))
-static char *lcc_strdup (const char *str) /* {{{ */
-{
- size_t strsize;
- char *ret;
-
- strsize = strlen (str) + 1;
- ret = (char *) malloc (strsize);
- if (ret != NULL)
- memcpy (ret, str, strsize);
- return (ret);
-} /* }}} char *lcc_strdup */
-
__attribute__((nonnull (1, 2)))
static char *lcc_strescape (char *dest, const char *src, size_t dest_size) /* {{{ */
{
lcc_chomp (buffer);
LCC_DEBUG ("receive: <-- %s\n", buffer);
- res.lines[i] = lcc_strdup (buffer);
+ res.lines[i] = strdup (buffer);
if (res.lines[i] == NULL)
{
lcc_set_errno (c, ENOMEM);
if (values_names != NULL)
{
- values_names[i] = lcc_strdup (key);
+ values_names[i] = strdup (key);
if (values_names[i] == NULL)
BAIL_OUT (ENOMEM);
}
char *type;
char *type_instance;
- string_copy = lcc_strdup (string);
+ string_copy = strdup (string);
if (string_copy == NULL)
{
lcc_set_errno (c, ENOMEM);