20 (*failure_notify) (
"xstrdup: tried to dup a nullptr!\n");
23 perror(
"xstrdup: tried to dup a nullptr!");
29 size_t sz = strlen(s) + 1;
30 char *p =
static_cast<char *
>(
xmalloc(sz));
45 while (--n != 0 && *src !=
'\0') {
61 (*failure_notify) (
"xstrndup: tried to dup a nullptr!\n");
63 perror(
"xstrndup: tried to dup a nullptr!");
68 size_t sz = strlen(s) + 1;
void(* failure_notify)(const char *)
char * xstrncpy(char *dst, const char *src, size_t n)
char * xstrdup(const char *s)
char * xstrndup(const char *s, size_t n)