From: tedu Date: Tue, 22 Apr 2014 21:24:20 +0000 (+0000) Subject: use reallocarray X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=f46a86e76161cda7aded89914c90fd8972ec8767;p=openbsd use reallocarray --- diff --git a/usr.bin/signify/signify.c b/usr.bin/signify/signify.c index 410d8967c33..fe2e9d6165a 100644 --- a/usr.bin/signify/signify.c +++ b/usr.bin/signify/signify.c @@ -1,4 +1,4 @@ -/* $OpenBSD: signify.c,v 1.71 2014/04/22 05:44:40 tedu Exp $ */ +/* $OpenBSD: signify.c,v 1.72 2014/04/22 21:24:20 tedu Exp $ */ /* * Copyright (c) 2013 Ted Unangst * @@ -549,8 +549,8 @@ verifychecksums(char *msg, int argc, char **argv, int quiet) line = msg; while (line && *line) { - if (!(checksums = realloc(checksums, - sizeof(*c) * (nchecksums + 1)))) + if (!(checksums = reallocarray(checksums, + nchecksums + 1, sizeof(*checksums)))) err(1, "realloc"); c = &checksums[nchecksums++]; if ((endline = strchr(line, '\n')))