diff options
Diffstat (limited to 'common/config-file.cpp')
-rw-r--r-- | common/config-file.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/common/config-file.cpp b/common/config-file.cpp index b56630f5c5..17b9fb2b4f 100644 --- a/common/config-file.cpp +++ b/common/config-file.cpp @@ -30,6 +30,19 @@ #define xfree(p) {if (p) free(p);} +#ifdef NEED_STRDUP +char *strdup(const char *s) { + if (s) { + int len = strlen(s) + 1; + char *d = (char *)malloc(len); + if (d) + memcpy(d, s, len); + return d; + } + return NULL; +} +#endif /* NEED_STRDUP */ + static char *ltrim(char *t) { |