diff options
author | Matthias Andree <matthias.andree@gmx.de> | 2010-04-10 17:49:23 +0200 |
---|---|---|
committer | Matthias Andree <matthias.andree@gmx.de> | 2010-04-10 18:03:10 +0200 |
commit | eec588b0b2d77eb2fe6d441efb6ab66ed538bedf (patch) | |
tree | 84fe1bc1465c1a1112503bb67d48b433de6edbfd /xmalloc.h | |
parent | 0c92635914becb4f6913c3f1d5a6f3756325315b (diff) | |
download | fetchmail-eec588b0b2d77eb2fe6d441efb6ab66ed538bedf.tar.gz fetchmail-eec588b0b2d77eb2fe6d441efb6ab66ed538bedf.tar.bz2 fetchmail-eec588b0b2d77eb2fe6d441efb6ab66ed538bedf.zip |
Add xstrndup().
Diffstat (limited to 'xmalloc.h')
-rw-r--r-- | xmalloc.h | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -25,4 +25,10 @@ XMALLOCTYPE *xrealloc(/*@null@*/ XMALLOCTYPE *, size_t n); * pointer, abort program on failure. */ char *xstrdup(const char *src); +/** Duplicate at most the first \a n characters from \a src to a newly + * malloc()d memory region and NUL-terminate it, and return its pointer, abort + * program on failure. The memory size is the lesser of either the string + * length including NUL byte or n + 1. */ +char *xstrndup(const char *src, size_t n); + #endif |