diff options
Diffstat (limited to 'mandoc.c')
-rw-r--r-- | mandoc.c | 10 |
1 files changed, 10 insertions, 0 deletions
@@ -432,6 +432,16 @@ mandoc_realloc(void *ptr, size_t size) return(ptr); } +char * +mandoc_strndup(const char *ptr, size_t sz) +{ + char *p; + + p = mandoc_malloc(sz + 1); + memcpy(p, ptr, sz); + p[(int)sz] = '\0'; + return(p); +} char * mandoc_strdup(const char *ptr) |