tool_operhlp: fix "potentially uninitialized local variable 'pc' used"

A false positive by MSVC.

Closes #14389
This commit is contained in:
Tal Regev 2024-08-05 01:03:09 +03:00 committed by Daniel Stenberg
parent 3eec5afbd0
commit 781c14c4ed
No known key found for this signature in database
GPG Key ID: 5CC908FDB71E12C2

View File

@ -182,7 +182,6 @@ fail:
*/
CURLcode get_url_file_name(char **filename, const char *url)
{
char *pc, *pc2;
CURLU *uh = curl_url();
char *path = NULL;
CURLUcode uerr;
@ -199,7 +198,7 @@ CURLcode get_url_file_name(char **filename, const char *url)
uh = NULL;
if(!uerr) {
int i;
char *pc = NULL, *pc2 = NULL;
for(i = 0; i < 2; i++) {
pc = strrchr(path, '/');
pc2 = strrchr(pc ? pc + 1 : path, '\\');