notmuch/util/talloc-extra.c
David Bremner 126347b694 Import notmuch_0.38.2.orig.tar.xz
[dgit import orig notmuch_0.38.2.orig.tar.xz]
2023-12-01 07:51:09 -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;
}