From: Olivier Houchard Date: Tue, 26 Feb 2019 17:48:01 +0000 (+0100) Subject: MINOR: cfgparse: Add a cast to make gcc happier. X-Git-Tag: v2.0-dev2~170 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=dd1c8f1f72;p=thirdparty%2Fhaproxy.git MINOR: cfgparse: Add a cast to make gcc happier. When calling calloc(), cast global.nbthread to unsigned int, so that gcc doesn't freak out, as it has no way of knowing global.nbthread can't be negative. --- diff --git a/src/cfgparse.c b/src/cfgparse.c index dcbcb48725..4c8b1fea92 100644 --- a/src/cfgparse.c +++ b/src/cfgparse.c @@ -3596,7 +3596,7 @@ out_uri_auth_compat: LIST_INIT(&toremove_connections[i]); } } - newsrv->idle_orphan_conns = calloc(global.nbthread, sizeof(*newsrv->idle_orphan_conns)); + newsrv->idle_orphan_conns = calloc((unsigned int)global.nbthread, sizeof(*newsrv->idle_orphan_conns)); if (!newsrv->idle_orphan_conns) goto err; for (i = 0; i < global.nbthread; i++)