From: Garrett Wollman Date: Sun, 15 Jul 2012 18:09:11 +0000 (-0400) Subject: util: LogCommandLine: argc is an int, so assert that it's positive X-Git-Tag: upstream/1.8.0_pre1^2~2220 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=e194a8b7f811a995e8f7147a12ac4be6e96f873f;p=packages%2Fo%2Fopenafs.git util: LogCommandLine: argc is an int, so assert that it's positive In practice, argc should never be negative, but by convention it's a signed int, so change the assertion to require it to be positive rather than merely nonzero to get some help to the static analyzer. Change-Id: I2d6c00b8ad2f8d573d717f1e2b88a4bb902f125c Reviewed-on: http://gerrit.openafs.org/7765 Tested-by: BuildBot Reviewed-by: Derrick Brashear --- diff --git a/src/util/serverLog.c b/src/util/serverLog.c index 08b7d828b..d94dd84fa 100644 --- a/src/util/serverLog.c +++ b/src/util/serverLog.c @@ -160,7 +160,7 @@ LogCommandLine(int argc, char **argv, const char *progname, int i, l; char *commandLine, *cx; - opr_Assert(argc != 0); + opr_Assert(argc > 0); for (l = i = 0; i < argc; i++) l += strlen(argv[i]) + 1;