Skip to content

Commit 52bfff5

Browse files
committed
Avoid variable reuse
1 parent 4d52e9c commit 52bfff5

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

osslsigncode.c

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4136,7 +4136,8 @@ static ENGINE *engine_dynamic(const char *path)
41364136
return NULL; /* FAILED */
41374137
}
41384138
if (path) { /* strip directory and extension */
4139-
char *ptr;
4139+
const char *ptr;
4140+
char *dot;
41404141

41414142
ptr = strrchr(path, '/');
41424143
if (!ptr) /* no slash -> try backslash */
@@ -4146,11 +4147,11 @@ static ENGINE *engine_dynamic(const char *path)
41464147
if (!strncmp(ptr, "lib", 3))
41474148
ptr += 3; /* skip the "lib" prefix */
41484149
} else /* directory separator not found */
4149-
ptr = (char *)path;
4150+
ptr = path;
41504151
id = OPENSSL_strdup(ptr);
4151-
ptr = strchr(id, '.');
4152-
if (ptr) /* file extensions found */
4153-
*ptr = '\0'; /* remove them */
4152+
dot = strchr(id, '.');
4153+
if (dot) /* file extensions found */
4154+
*dot = '\0'; /* remove them */
41544155
} else {
41554156
id = OPENSSL_strdup("pkcs11");
41564157
}

0 commit comments

Comments
 (0)