diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2007-09-02 23:50:05 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2007-09-02 23:50:05 +0000 |
commit | 03059e279945b4acbfbc6fc65c70c7d1ba77bb55 (patch) | |
tree | 105f0ad8a4c221d0b5cf3ab631a67266dc8fa22b /usr.bin/dc | |
parent | 34bab3a7fcc73c4a4de55b918cebcbbcc95ff927 (diff) |
more malloc(n * m) -> calloc(n, m); from Igor Zinovik
Diffstat (limited to 'usr.bin/dc')
-rw-r--r-- | usr.bin/dc/bcode.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/usr.bin/dc/bcode.c b/usr.bin/dc/bcode.c index 10a997a09c6..c693febb202 100644 --- a/usr.bin/dc/bcode.c +++ b/usr.bin/dc/bcode.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bcode.c,v 1.34 2006/01/19 20:06:55 otto Exp $ */ +/* $OpenBSD: bcode.c,v 1.35 2007/09/02 23:50:04 deraadt Exp $ */ /* * Copyright (c) 2003, Otto Moerbeek <otto@drijf.net> @@ -17,7 +17,7 @@ */ #ifndef lint -static const char rcsid[] = "$OpenBSD: bcode.c,v 1.34 2006/01/19 20:06:55 otto Exp $"; +static const char rcsid[] = "$OpenBSD: bcode.c,v 1.35 2007/09/02 23:50:04 deraadt Exp $"; #endif /* not lint */ #include <ssl/ssl.h> @@ -239,7 +239,7 @@ init_bmachine(bool extended_registers) bmachine.reg_array_size = bmachine.extended_regs ? REG_ARRAY_SIZE_BIG : REG_ARRAY_SIZE_SMALL; - bmachine.reg = malloc(bmachine.reg_array_size * + bmachine.reg = calloc(bmachine.reg_array_size, sizeof(bmachine.reg[0])); if (bmachine.reg == NULL) err(1, NULL); @@ -255,7 +255,7 @@ init_bmachine(bool extended_registers) stack_init(&bmachine.reg[i]); bmachine.readstack_sz = READSTACK_SIZE; - bmachine.readstack = malloc(sizeof(struct source) * + bmachine.readstack = calloc(sizeof(struct source), bmachine.readstack_sz); if (bmachine.readstack == NULL) err(1, NULL); |