summaryrefslogtreecommitdiff
path: root/openbsd-compat/recallocarray.c
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>2017-06-01 16:25:09 +1000
committerDamien Miller <djm@mindrot.org>2017-06-01 16:25:26 +1000
commit65eb8fae0d7ba45ef4483a3cf0ae7fd0dbc7c226 (patch)
tree5e912d0b0d64eeae0392ab87c9f8288a292f5403 /openbsd-compat/recallocarray.c
parent2d75d74272dc2a0521fce13cfe6388800c9a2406 (diff)
avoid compiler warning
Diffstat (limited to 'openbsd-compat/recallocarray.c')
-rw-r--r--openbsd-compat/recallocarray.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/openbsd-compat/recallocarray.c b/openbsd-compat/recallocarray.c
index 506741708..c281f75e9 100644
--- a/openbsd-compat/recallocarray.c
+++ b/openbsd-compat/recallocarray.c
@@ -62,7 +62,7 @@ recallocarray(void *ptr, size_t oldnmemb, size_t newnmemb, size_t size)
62 if (newsize <= oldsize) { 62 if (newsize <= oldsize) {
63 size_t d = oldsize - newsize; 63 size_t d = oldsize - newsize;
64 64
65 if (d < oldsize / 2 && d < getpagesize()) { 65 if (d < oldsize / 2 && d < (size_t)getpagesize()) {
66 memset((char *)ptr + newsize, 0, d); 66 memset((char *)ptr + newsize, 0, d);
67 return ptr; 67 return ptr;
68 } 68 }