diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2014-10-14 15:35:41 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2014-10-14 15:35:41 +0000 |
commit | 931d39ec0ef8235f9cbfb8d72d177594486ff276 (patch) | |
tree | 6e7dac76ccc8df770d4bb6f83775473381073b8c /usr.bin/bc | |
parent | 897fd7cf543322f9234b4d5b0ebc991dac4060a4 (diff) |
obvious use of reallocarray()
Diffstat (limited to 'usr.bin/bc')
-rw-r--r-- | usr.bin/bc/bc.y | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.bin/bc/bc.y b/usr.bin/bc/bc.y index 39ed0cb3597..f7d5a158559 100644 --- a/usr.bin/bc/bc.y +++ b/usr.bin/bc/bc.y @@ -1,5 +1,5 @@ %{ -/* $OpenBSD: bc.y,v 1.45 2014/10/08 04:13:33 deraadt Exp $ */ +/* $OpenBSD: bc.y,v 1.46 2014/10/14 15:35:18 deraadt Exp $ */ /* * Copyright (c) 2003, Otto Moerbeek <otto@drijf.net> @@ -750,7 +750,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); |