@@ -16,3 +16,11 @@ void str_redup(char **str, const char *newstr)
egg_memcpy(*str, newstr, len);
}
+char *strdup(const char *entry)
+{
+ char *target = (char*)malloc(strlen(entry) + 1);
+ if (target == 0) return 0;
+ strcpy(target, entry);
+ return target;
+}
+
@@ -1,8 +1,10 @@
#ifndef _MEMUTIL_H
#define _MEMUTIL_H
+#undef strdup
+#undef str_redup
void str_redup(char **, const char *);
-
+char *strdup(const char *);
#endif /* !_MEMUTIL_H */