mirror of
https://github.com/mtrojnar/osslsigncode.git
synced 2025-07-03 03:32:47 -05:00
Avoid variable reuse
This commit is contained in:
@ -4136,7 +4136,8 @@ static ENGINE *engine_dynamic(const char *path)
|
|||||||
return NULL; /* FAILED */
|
return NULL; /* FAILED */
|
||||||
}
|
}
|
||||||
if (path) { /* strip directory and extension */
|
if (path) { /* strip directory and extension */
|
||||||
char *ptr;
|
const char *ptr;
|
||||||
|
char *dot;
|
||||||
|
|
||||||
ptr = strrchr(path, '/');
|
ptr = strrchr(path, '/');
|
||||||
if (!ptr) /* no slash -> try backslash */
|
if (!ptr) /* no slash -> try backslash */
|
||||||
@ -4146,11 +4147,11 @@ static ENGINE *engine_dynamic(const char *path)
|
|||||||
if (!strncmp(ptr, "lib", 3))
|
if (!strncmp(ptr, "lib", 3))
|
||||||
ptr += 3; /* skip the "lib" prefix */
|
ptr += 3; /* skip the "lib" prefix */
|
||||||
} else /* directory separator not found */
|
} else /* directory separator not found */
|
||||||
ptr = (char *)path;
|
ptr = path;
|
||||||
id = OPENSSL_strdup(ptr);
|
id = OPENSSL_strdup(ptr);
|
||||||
ptr = strchr(id, '.');
|
dot = strchr(id, '.');
|
||||||
if (ptr) /* file extensions found */
|
if (dot) /* file extensions found */
|
||||||
*ptr = '\0'; /* remove them */
|
*dot = '\0'; /* remove them */
|
||||||
} else {
|
} else {
|
||||||
id = OPENSSL_strdup("pkcs11");
|
id = OPENSSL_strdup("pkcs11");
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user