Browse Source

* #undef strdup
#undef str_redup

Now using our own compat functions for strdup/str_redup


svn: 681

Bryan Drewery 22 years ago
parent
commit
cedc10bf5e
2 changed files with 11 additions and 1 deletions
  1. 8 0
      src/compat/memutil.c
  2. 3 1
      src/compat/memutil.h

+ 8 - 0
src/compat/memutil.c

@@ -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;
+}
+

+ 3 - 1
src/compat/memutil.h

@@ -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 */