]> git.ipfire.org Git - thirdparty/mdadm.git/blobdiff - dlink.c
Fix parallel make problem.
[thirdparty/mdadm.git] / dlink.c
diff --git a/dlink.c b/dlink.c
index de42632c37ae982f9e2adc32955665da347a5bf6..3efa94b751ab233ee50ae7d03228490065fe6b7d 100644 (file)
--- a/dlink.c
+++ b/dlink.c
@@ -5,9 +5,12 @@
 #include       <unistd.h>
 #include       <stdlib.h>
 #include       <string.h>
+#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"
 
-
 void *dl_head()
 {
     void *h;
@@ -60,14 +63,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)