summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorPavel Březina <pbrezina@redhat.com>2012-04-16 13:12:41 +0200
committerVolker Lendecke <vl@samba.org>2012-04-18 10:27:15 +0200
commitc5243a499f735b4b999dfe4be59a3bec90c6d4b9 (patch)
tree0a10e04fb63303697d9ee2d87ee0bad629c7b22c /lib
parent3502371a34280abaa8332b4f45b405f609736bec (diff)
downloadsamba-c5243a499f735b4b999dfe4be59a3bec90c6d4b9.tar.gz
samba-c5243a499f735b4b999dfe4be59a3bec90c6d4b9.tar.bz2
samba-c5243a499f735b4b999dfe4be59a3bec90c6d4b9.zip
Talloc doc: talloc_strndup_append()
The destination string is reallocated instead of duplicating the result.
Diffstat (limited to 'lib')
-rw-r--r--lib/talloc/talloc.h14
1 files changed, 12 insertions, 2 deletions
diff --git a/lib/talloc/talloc.h b/lib/talloc/talloc.h
index 419bb53ea1..a77740f669 100644
--- a/lib/talloc/talloc.h
+++ b/lib/talloc/talloc.h
@@ -1373,8 +1373,17 @@ char *talloc_strdup_append_buffer(char *s, const char *a);
char *talloc_strndup(const void *t, const char *p, size_t n);
/**
- * @brief Append at most n characters of a string to given string and duplicate
- * the result.
+ * @brief Append at most n characters of a string to given string.
+ *
+ * The destination string is reallocated to take
+ * <code>strlen(s) + strnlen(a, n) + 1</code> characters.
+ *
+ * This functions sets the name of the new pointer to the new
+ * string. This is equivalent to:
+ *
+ * @code
+ * talloc_set_name_const(ptr, ptr)
+ * @endcode
*
* @param[in] s The destination string to append to.
*
@@ -1386,6 +1395,7 @@ char *talloc_strndup(const void *t, const char *p, size_t n);
* @return The duplicated string, NULL on error.
*
* @see talloc_strndup()
+ * @see talloc_strndup_append_buffer()
*/
char *talloc_strndup_append(char *s, const char *a, size_t n);