diff options
author | Sebastian Rasmussen <sebras@hotmail.com> | 2009-04-26 23:06:32 +0200 |
---|---|---|
committer | Sebastian Rasmussen <sebras@hotmail.com> | 2009-04-26 23:06:32 +0200 |
commit | 835490a4a93bf9bd7c175b7c8a869a67762a148d (patch) | |
tree | d5a1cc03c194c07444ab3a91259e2115977760b2 | |
parent | 1a50059d39cd9eded569307df08a1bac088e8f76 (diff) | |
download | mupdf-835490a4a93bf9bd7c175b7c8a869a67762a148d.tar.xz |
Get rid of that pesky warning about strdup not being available.
-rw-r--r-- | fitz/base_memory.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/fitz/base_memory.c b/fitz/base_memory.c index e583dc9e..1f224ddb 100644 --- a/fitz/base_memory.c +++ b/fitz/base_memory.c @@ -23,9 +23,10 @@ void fz_free(void *p) char * fz_strdup(char *s) { - char *ns = strdup(s); + char *ns = malloc(strlen(s) + 1); if (!ns) fz_throw("cannot strdup %lu bytes", (unsigned long)strlen(s) + 1); + memcpy(ns, s, strlen(s) + 1); return ns; } |