aboutsummaryrefslogtreecommitdiff
path: root/util/talloc-extra.c
diff options
context:
space:
mode:
authorDavid Bremner <bremner@debian.org>2018-06-12 22:39:33 -0300
committerDavid Bremner <bremner@debian.org>2018-06-12 22:39:33 -0300
commit045f0e455ac94e2393d0d729c9bbdf3459a4860f (patch)
tree8d8b46ecba2c3c128365f16ece54377b987dbe58 /util/talloc-extra.c
Import notmuch_0.27.orig.tar.gz
[dgit import orig notmuch_0.27.orig.tar.gz]
Diffstat (limited to 'util/talloc-extra.c')
-rw-r--r--util/talloc-extra.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/util/talloc-extra.c b/util/talloc-extra.c
new file mode 100644
index 00000000..96262470
--- /dev/null
+++ b/util/talloc-extra.c
@@ -0,0 +1,14 @@
+#include <string.h>
+#include "talloc-extra.h"
+
+char *
+talloc_strndup_named_const (void *ctx, const char *str,
+ size_t len, const char *name)
+{
+ char *ptr = talloc_strndup (ctx, str, len);
+
+ if (ptr)
+ talloc_set_name_const (ptr, name);
+
+ return ptr;
+}