diff options
author | Damien Miller <djm@cvs.openbsd.org> | 2006-04-02 21:38:58 +0000 |
---|---|---|
committer | Damien Miller <djm@cvs.openbsd.org> | 2006-04-02 21:38:58 +0000 |
commit | 5b14fea36497511e6428b2c588513d92bc92cb90 (patch) | |
tree | 0b66759932d131cfb42148e0672334d215e6b99f /lib/libc/locale | |
parent | ba37f6b6fd488dbe7dd7be429e8b7a994a783155 (diff) |
malloc(x * y) -> calloc(x, y) from adobriyan AT gmail.com, with tweaks
suggested by kjell@; ok otto@ pat@ millert@ jaredy@
Diffstat (limited to 'lib/libc/locale')
-rw-r--r-- | lib/libc/locale/rune.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/libc/locale/rune.c b/lib/libc/locale/rune.c index cb0805e08b8..1ccd0871a61 100644 --- a/lib/libc/locale/rune.c +++ b/lib/libc/locale/rune.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rune.c,v 1.1 2005/08/07 10:16:23 espie Exp $ */ +/* $OpenBSD: rune.c,v 1.2 2006/04/02 21:38:57 djm Exp $ */ /* $NetBSD: rune.c,v 1.26 2004/05/09 11:26:33 kleink Exp $ */ /*- @@ -124,12 +124,11 @@ readentry(_RuneRange *rr, FILE *fp) } l = re[i].re_max - re[i].re_min + 1; - re[i].re_rune_types = malloc(l * sizeof(_RuneType)); + re[i].re_rune_types = calloc(l, sizeof(_RuneType)); if (!re[i].re_rune_types) { error = ENOMEM; goto fail; } - memset(re[i].re_rune_types, 0, l * sizeof(_RuneType)); if (fread(re[i].re_rune_types, sizeof(_RuneType), l, fp) != l) goto fail2; |