summaryrefslogtreecommitdiffstats
path: root/src/core/string.c
diff options
context:
space:
mode:
authorMichael Brown2006-12-08 01:34:47 +0100
committerMichael Brown2006-12-08 01:34:47 +0100
commit496563071d22166522a4ec9887357dde00d07fdc (patch)
treee13aa34801f29413b766367f8d9b6e1c74850c3a /src/core/string.c
parentAdded missing prototype (diff)
downloadipxe-496563071d22166522a4ec9887357dde00d07fdc.tar.gz
ipxe-496563071d22166522a4ec9887357dde00d07fdc.tar.xz
ipxe-496563071d22166522a4ec9887357dde00d07fdc.zip
Added strdup()
Diffstat (limited to 'src/core/string.c')
-rw-r--r--src/core/string.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/core/string.c b/src/core/string.c
index 856f955b..da35e208 100644
--- a/src/core/string.c
+++ b/src/core/string.c
@@ -21,8 +21,9 @@
* reentrant and should be faster). Use only strsep() in new code, please.
*/
-#include "etherboot.h"
-
+#include <stdint.h>
+#include <stdlib.h>
+#include <string.h>
/* *** FROM string.c *** */
@@ -538,3 +539,10 @@ void * memchr(const void *s, int c, size_t n)
}
#endif
+
+char * strdup(const char *s) {
+ char *new = malloc(strlen(s)+1);
+ if (new)
+ strcpy(new,s);
+ return new;
+}