summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 0230ae2)
raw | patch | inline | side by side (parent: 0230ae2)
author | Florian Forster <octo@huhu.verplant.org> | |
Sat, 8 Jan 2011 08:32:57 +0000 (09:32 +0100) | ||
committer | Florian Forster <octo@huhu.verplant.org> | |
Sat, 8 Jan 2011 08:32:57 +0000 (09:32 +0100) |
We use XSI anyway, so why go there?
src/libcollectdclient/client.c | patch | blob | history |
index 75ac7b6da0b96c1d901007ab8dd1f2d4c0470e06..9ee02c9ff6ba9bc92a5d11ea2cef5d52ba1bf889 100644 (file)
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);