summaryrefslogtreecommitdiffstats
path: root/array.h
diff options
context:
space:
mode:
authornicm <nicm>2014-10-08 17:35:58 +0000
committernicm <nicm>2014-10-08 17:35:58 +0000
commita27ba6e38006c12c48de88600b8cff9f6aabfed7 (patch)
treefc8ecf1c1b965f70b95d0a3e472cd0b1a2e1d2c9 /array.h
parent77efcf8bdd14cd19dc445cf6e44bba7af414939c (diff)
Add xreallocarray and remove nmemb argument from xrealloc.
Diffstat (limited to 'array.h')
-rw-r--r--array.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/array.h b/array.h
index c811bf6d..671bea42 100644
--- a/array.h
+++ b/array.h
@@ -39,10 +39,10 @@
fatalx("size too big"); \
if ((a)->space == 0) { \
(a)->space = ARRAY_INITIALSPACE(a); \
- (a)->list = xrealloc((a)->list, 1, (a)->space); \
+ (a)->list = xrealloc((a)->list, (a)->space); \
} \
while ((a)->space <= ((a)->num + (n)) * ARRAY_ITEMSIZE(a)) { \
- (a)->list = xrealloc((a)->list, 2, (a)->space); \
+ (a)->list = xreallocarray((a)->list, 2, (a)->space); \
(a)->space *= 2; \
} \
} while (0)