X-Git-Url: https://git.notmuchmail.org/git?p=notmuch;a=blobdiff_plain;f=util%2Ftalloc-extra.c;fp=util%2Ftalloc-extra.c;h=962624707dcc603321aff60fc83b2c50bffa3ece;hp=0000000000000000000000000000000000000000;hb=0cfb8a24dc025335643a5cfa344c62e5584fb477;hpb=3380498042ffe830476bf12e75075cd826b10c4b 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 +#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; +}