← Commit list

b825417043

Daniel Stenberg
Daniel Stenberg
2026-06-02
SUCCESS Duration: 254s

Subject

tool_operhlp: avoid NULL to %s

Binary

No binary (build failed)

Architecture & Compiler Flags

Architecture: x86_64-linux-gnu Compiler: gcc (Ubuntu 11.4.0-1ubuntu1~22.04.3) 11.4.0

—

Build Log

(log yok)

Commit Diff GitHub →

src/tool_operhlp.c+5 -2
@@ -175,6 +175,8 @@ out:
return result;
}
+#define DEFAULT_FILENAME "curl_response"
+
/* Extracts the name portion of the URL.
* Returns a pointer to a heap-allocated string or NULL if
* no name part, at location indicated by first argument.
@@ -218,8 +220,9 @@ CURLcode get_url_file_name(char **filename, const char *url, SANITIZEcode *sc)
}
else {
/* no slash => empty string, use default */
- *filename = curlx_strdup("curl_response");
- warnf("No remote filename, uses \"%s\"", *filename);
+ *filename = curlx_strdup(DEFAULT_FILENAME);
+ if(*filename)
+ warnf("No remote filename, uses \"" DEFAULT_FILENAME "\"");
}
curl_free(path);