bayou compile fixes
[coreboot.git] / payloads / bayou / util / pbuilder / config.c
index 7b517335e37159b41aab20a9cbf2148f703310b6..a1d49fb69c508f4e55a5982607e753b79ab508d6 100644 (file)
@@ -66,6 +66,20 @@ static struct {
        {NULL},
 };
 
+#ifndef __LINUX__
+static char *strndup (const char *s, size_t n)
+{
+       size_t len = strlen (s);
+       len = (len<n)?len:n;
+       char *cpy = malloc (len + 1);
+       if (cpy == NULL)
+               return NULL;
+       cpy[len] = '\0';
+       memcpy (cpy, s, len);
+       return cpy;
+}
+#endif
+
 static struct pentry *newPayload(struct config *config)
 {
        struct pentry **tmp, *ret;