From: Simon Wilkinson Date: Sun, 7 Aug 2011 18:41:51 +0000 (+0100) Subject: util: LogCommandLine has to have a command line X-Git-Tag: upstream/1.8.0_pre1^2~2628 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=2454e3d96af2be9f316a5c50199d34444defe4a8;p=packages%2Fo%2Fopenafs.git util: LogCommandLine has to have a command line Add an assert() to LogCommandLine to catch the case where it is called without a command line to log. Change-Id: Ia1be28b3a1d1d4e144626976f0f82b9675809c0a Reviewed-on: http://gerrit.openafs.org/7072 Reviewed-by: Derrick Brashear Tested-by: Derrick Brashear --- diff --git a/src/util/serverLog.c b/src/util/serverLog.c index f32a5069f..ebe9fbca3 100644 --- a/src/util/serverLog.c +++ b/src/util/serverLog.c @@ -23,6 +23,7 @@ #include /* signal(), kill(), wait(), etc. */ #include /* Must come after procmgmt.h */ +#include #include "afsutil.h" #include "fileutil.h" @@ -160,6 +161,8 @@ LogCommandLine(int argc, char **argv, const char *progname, int i, l; char *commandLine, *cx; + opr_Assert(argc != 0); + for (l = i = 0; i < argc; i++) l += strlen(argv[i]) + 1; if ((commandLine = malloc(l))) {