aboutsummaryrefslogtreecommitdiffstats
path: root/memdup.c
diff options
context:
space:
mode:
Diffstat (limited to 'memdup.c')
-rw-r--r--memdup.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/memdup.c b/memdup.c
index a1d0959..5d158b0 100644
--- a/memdup.c
+++ b/memdup.c
@@ -6,7 +6,7 @@
void *
libsimple_memdup(const void *s, size_t n)
{
- void *ret = malloc(n ? n : (size_t)1);
+ void *ret = malloc(n + !n);
if (!ret)
return NULL;
return memcpy(ret, s, n);