First committed to wrong branch, sorry.
-/* $Id: cgi.c,v 1.50 2014/03/23 12:19:03 schwarze Exp $ */
+/* $Id: cgi.c,v 1.51 2014/04/23 21:40:47 schwarze Exp $ */
/*
* Copyright (c) 2011, 2012 Kristaps Dzonsons <kristaps@bsd.lv>
*
/*
* Copyright (c) 2011, 2012 Kristaps Dzonsons <kristaps@bsd.lv>
*
ep++;
while (ep && '\0' != *ep) {
ep++;
while (ep && '\0' != *ep) {
- cp = mandoc_realloc(cp, (sz + 1) * sizeof(char *));
+ cp = mandoc_reallocarray(cp, sz + 1, sizeof(char *));
start = ep;
while ('\0' != *ep && ! isspace((unsigned char)*ep))
ep++;
start = ep;
while ('\0' != *ep && ! isspace((unsigned char)*ep))
ep++;
if (rc > 0) {
/* This also strips the trailing slash. */
path[(int)--sz] = '\0';
if (rc > 0) {
/* This also strips the trailing slash. */
path[(int)--sz] = '\0';
- req->p = mandoc_realloc
- (req->p,
- (req->psz + 1) * sizeof(struct paths));
+ req->p = mandoc_reallocarray(req->p,
+ req->psz + 1, sizeof(struct paths));
/*
* Strip out the leading "./" unless we're just a ".",
* in which case use an empty string as our name.
/*
* Strip out the leading "./" unless we're just a ".",
* in which case use an empty string as our name.