aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--pw.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/pw.c b/pw.c
index 6c36a90..28d1e98 100644
--- a/pw.c
+++ b/pw.c
@@ -1780,7 +1780,7 @@ int main(int argc, char **argv)
&cmdhist : &pathist);
if (nhist == 0 || strcmp(pw.cmdbuf, (*hist)[0]) != 0) {
- if ((*hist = realloc(*hist, sizeof **hist*(nhist + 1))) == 0)
+ if ((*hist = resizebuf(*hist, nhist, nhist + 1)) == 0)
panic("out of memory");
memmove(*hist + 1, *hist, sizeof **hist * nhist);
*pnhist = nhist + 1;