diff options
-rw-r--r-- | pw.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -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; |