]> git.notmuchmail.org Git - notmuch/blob - util/talloc-extra.c
gmime-cleanup: pass NULL arguments explicitly where GMime 3.0 expects it
[notmuch] / util / talloc-extra.c
1 #include <string.h>
2 #include "talloc-extra.h"
3
4 char *
5 talloc_strndup_named_const (void *ctx, const char *str,
6                             size_t len, const char *name)
7 {
8     char *ptr = talloc_strndup (ctx, str, len);
9
10     if (ptr)
11         talloc_set_name_const (ptr, name);
12
13     return ptr;
14 }