Fix faulty check in the VMS version of opt_progname

Reviewed-by: Stephen Henson <steve@openssl.org>
This commit is contained in:
Richard Levitte 2015-12-30 16:57:05 +01:00
parent 579415de54
commit 211a68b41a

View 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;
}