=================================================================== RCS file: /cvs/mandoc/mandocdb.c,v retrieving revision 1.143 retrieving revision 1.144 diff -u -p -r1.143 -r1.144 --- mandoc/mandocdb.c 2014/04/23 19:09:16 1.143 +++ mandoc/mandocdb.c 2014/04/23 21:06:41 1.144 @@ -1,4 +1,4 @@ -/* $Id: mandocdb.c,v 1.143 2014/04/23 19:09:16 schwarze Exp $ */ +/* $Id: mandocdb.c,v 1.144 2014/04/23 21:06:41 schwarze Exp $ */ /* * Copyright (c) 2011, 2012 Kristaps Dzonsons * Copyright (c) 2011, 2012, 2013, 2014 Ingo Schwarze @@ -471,8 +471,8 @@ main(int argc, char *argv[]) * manpath_parse() wants to do it. */ if (argc > 0) { - dirs.paths = mandoc_calloc(argc, - sizeof(char *)); + dirs.paths = mandoc_reallocarray(NULL, + argc, sizeof(char *)); dirs.sz = (size_t)argc; for (i = 0; i < argc; i++) dirs.paths[i] = mandoc_strdup(argv[i]); @@ -1784,7 +1784,7 @@ putkeys(const struct mpage *mpage, s->mask |= v; return; } else if (NULL == s) { - s = mandoc_calloc(sizeof(struct str) + sz + 1, 1); + s = mandoc_calloc(1, sizeof(struct str) + sz + 1); memcpy(s->key, cp, sz); ohash_insert(htab, slot, s); } @@ -2314,7 +2314,7 @@ static void * hash_halloc(size_t sz, void *arg) { - return(mandoc_calloc(sz, 1)); + return(mandoc_calloc(1, sz)); } static void *