From 2454e3d96af2be9f316a5c50199d34444defe4a8 Mon Sep 17 00:00:00 2001 From: Simon Wilkinson Date: Sun, 7 Aug 2011 19:41:51 +0100 Subject: [PATCH] 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 --- src/util/serverLog.c | 3 +++ 1 file changed, 3 insertions(+) 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))) { -- 2.39.5