aboutsummaryrefslogtreecommitdiff
path: root/usr.bin/bc/bc.y
diff options
context:
space:
mode:
Diffstat (limited to 'usr.bin/bc/bc.y')
-rw-r--r--usr.bin/bc/bc.y6
1 files changed, 3 insertions, 3 deletions
diff --git a/usr.bin/bc/bc.y b/usr.bin/bc/bc.y
index 17f308edf690..50ac130b461c 100644
--- a/usr.bin/bc/bc.y
+++ b/usr.bin/bc/bc.y
@@ -1,5 +1,5 @@
%{
-/* $OpenBSD: bc.y,v 1.44 2013/11/20 21:33:54 deraadt Exp $ */
+/* $OpenBSD: bc.y,v 1.46 2014/10/14 15:35:18 deraadt Exp $ */
/*
* Copyright (c) 2003, Otto Moerbeek <otto@drijf.net>
@@ -771,7 +771,7 @@ grow(void)
if (current == instr_sz) {
newsize = instr_sz * 2 + 1;
- p = realloc(instructions, newsize * sizeof(*p));
+ p = reallocarray(instructions, newsize, sizeof(*p));
if (p == NULL) {
free(instructions);
err(1, NULL);
@@ -1132,7 +1132,7 @@ main(int argc, char *argv[])
init();
setvbuf(stdout, NULL, _IOLBF, 0);
- sargv = malloc(argc * sizeof(char *));
+ sargv = reallocarray(NULL, argc, sizeof(char *));
if (sargv == NULL)
err(1, NULL);