]> granicus.if.org Git - sudo/commitdiff
now deals with Argv == 1
authorTodd C. Miller <Todd.Miller@courtesan.com>
Thu, 8 Jun 1995 01:36:02 +0000 (01:36 +0000)
committerTodd C. Miller <Todd.Miller@courtesan.com>
Thu, 8 Jun 1995 01:36:02 +0000 (01:36 +0000)
logging.c

index 8be0bbdb71e8254b48500ff8199d3f8bd12d10d3..100b3fede290018894ff83469483f4038fbbf163 100644 (file)
--- a/logging.c
+++ b/logging.c
@@ -251,9 +251,14 @@ void log_error(code)
        strcat(logline, cmnd);  /* stuff the command into the logline */
        strcat(logline, " ");
 
-       argc = Argc - 2;
-       argv = Argv;
-       argv++;
+       if (Argc > 1) {
+           argc = Argc - 2;
+           argv = Argv + 1;
+       } else {
+           argc = Argc - 1;
+           argv = Argv;
+       }
+
        p = logline + strlen(logline);
        count = (int) (logline + MAXLOGLEN - p);