diff options
Diffstat (limited to 'dlink.c')
-rw-r--r-- | dlink.c | 12 |
1 files changed, 4 insertions, 8 deletions
@@ -8,6 +8,7 @@ #ifdef __dietlibc__ char *strncpy(char *dest, const char *src, size_t n) __THROW; #endif +void *xcalloc(size_t num, size_t size); #include "dlink.h" @@ -63,14 +64,9 @@ char *dl_strndup(char *s, int l) if (s == NULL) return NULL; n = dl_newv(char, l+1); - if (n == NULL) - return NULL; - else - { - strncpy(n, s, l); - n[l] = 0; - return n; - } + strncpy(n, s, l); + n[l] = 0; + return n; } char *dl_strdup(char *s) |