summaryrefslogtreecommitdiff
path: root/fitz/base_memory.c
diff options
context:
space:
mode:
authorSebastian Rasmussen <sebras@hotmail.com>2009-04-26 23:06:32 +0200
committerSebastian Rasmussen <sebras@hotmail.com>2009-04-26 23:06:32 +0200
commit835490a4a93bf9bd7c175b7c8a869a67762a148d (patch)
treed5a1cc03c194c07444ab3a91259e2115977760b2 /fitz/base_memory.c
parent1a50059d39cd9eded569307df08a1bac088e8f76 (diff)
downloadmupdf-835490a4a93bf9bd7c175b7c8a869a67762a148d.tar.xz
Get rid of that pesky warning about strdup not being available.
Diffstat (limited to 'fitz/base_memory.c')
-rw-r--r--fitz/base_memory.c3
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;
}