From 835490a4a93bf9bd7c175b7c8a869a67762a148d Mon Sep 17 00:00:00 2001 From: Sebastian Rasmussen Date: Sun, 26 Apr 2009 23:06:32 +0200 Subject: Get rid of that pesky warning about strdup not being available. --- fitz/base_memory.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'fitz/base_memory.c') 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; } -- cgit v1.2.3