Fix faulty check in the VMS version of opt_progname
authorRichard Levitte <levitte@openssl.org>
Wed, 30 Dec 2015 15:57:05 +0000 (16:57 +0100)
committerRichard Levitte <levitte@openssl.org>
Wed, 30 Dec 2015 15:57:05 +0000 (16:57 +0100)
Reviewed-by: Stephen Henson <steve@openssl.org>
apps/opt.c

index 90a9d84e47c141db7b9f6465ad5fef87f2bf4053..853c981ce6be25b74802692e63baafb1e63c59d6 100644 (file)
@@ -127,7 +127,7 @@ char *opt_progname(const char *argv0)
     q = strrchr(p, '.');
     strncpy(prog, p, sizeof prog - 1);
     prog[sizeof prog - 1] = '\0';
-    if (q == NULL || q - p >= sizeof prog)
+    if (q != NULL && q - p < sizeof prog)
         prog[q - p] = '\0';
     return prog;
 }