From: Tal Regev Date: Sun, 4 Aug 2024 22:03:09 +0000 (+0300) Subject: tool_operhlp: fix "potentially uninitialized local variable 'pc' used" X-Git-Tag: curl-8_10_0~389 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=781c14c4ed7c582bb7213208fe12262d9ecb7724;p=thirdparty%2Fcurl.git tool_operhlp: fix "potentially uninitialized local variable 'pc' used" A false positive by MSVC. Closes #14389 --- diff --git a/src/tool_operhlp.c b/src/tool_operhlp.c index 8d356d9e4a..be5bc0a260 100644 --- a/src/tool_operhlp.c +++ b/src/tool_operhlp.c @@ -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, '\\');