tool: use errorf() for error output

Convert a number of fprintf() calls.
This commit is contained in:
Daniel Stenberg 2023-05-31 09:34:02 +02:00
parent 6d45b9ca9c
commit 741f7ed4bc
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2
10 changed files with 38 additions and 37 deletions

View file

@ -26,8 +26,8 @@
#define CURL_DO_NOT_OVERRIDE_STDERR
#include "tool_setup.h"
#include "tool_stderr.h"
#include "tool_msgs.h"
#include "memdebug.h" /* keep this as LAST include */
@ -39,7 +39,7 @@ void tool_init_stderr(void)
tool_stderr = stderr;
}
void tool_set_stderr_file(char *filename)
void tool_set_stderr_file(struct GlobalConfig *global, char *filename)
{
FILE *fp;
@ -55,7 +55,7 @@ void tool_set_stderr_file(char *filename)
subsequent freopen will fail. */
fp = fopen(filename, FOPEN_WRITETEXT);
if(!fp) {
fprintf(tool_stderr, "Warning: Failed to open %s!\n", filename);
warnf(global, "Warning: Failed to open %s", filename);
return;
}
fclose(fp);