notmuch/util/talloc-extra.c
David Bremner 0cfb8a24dc util: add talloc-extra.[ch]
These are intended to be simple wrappers to provide slightly better
debugging information than what talloc currently provides natively.
2012-12-30 21:12:11 -04:00

14 lines
266 B
C

#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;
}