tool: remove newlines from all helpf/notef/warnf/errorf calls

Make voutf() always add one.

Closes #11226
This commit is contained in:
Daniel Stenberg 2023-05-30 14:44:56 +02:00
parent 4efa0b5749
commit 6d45b9ca9c
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2
13 changed files with 120 additions and 116 deletions

View file

@ -202,7 +202,7 @@ size_t tool_mime_stdin_read(char *buffer,
if(ferror(stdin)) {
/* Show error only once. */
if(sip->config) {
warnf(sip->config, "stdin: %s\n", strerror(errno));
warnf(sip->config, "stdin: %s", strerror(errno));
sip->config = NULL;
}
return CURL_READFUNC_ABORT;
@ -369,7 +369,7 @@ static char *get_param_word(struct OperationConfig *config, char **str,
++ptr;
}
if(trailing_data)
warnf(config->global, "Trailing data after quoted form parameter\n");
warnf(config->global, "Trailing data after quoted form parameter");
*str = ptr;
return word_begin + 1;
}
@ -448,7 +448,7 @@ static int read_field_headers(struct OperationConfig *config,
pos++;
if(!incomment) {
if(hdrlen == sizeof(hdrbuf) - 1) {
warnf(config->global, "File %s line %d: header too long (truncated)\n",
warnf(config->global, "File %s line %d: header too long (truncated)",
filename, lineno);
c = ' ';
}
@ -506,7 +506,7 @@ static int get_param_part(struct OperationConfig *config, char endchar,
/* verify that this is a fine type specifier */
if(2 != sscanf(type, "%127[^/ ]/%127[^;, \n]", type_major, type_minor)) {
warnf(config->global, "Illegally formatted content-type field!\n");
warnf(config->global, "Illegally formatted content-type field!");
curl_slist_free_all(headers);
return -1; /* illegal content-type syntax! */
}
@ -558,7 +558,7 @@ static int get_param_part(struct OperationConfig *config, char endchar,
*endpos = '\0';
fp = fopen(hdrfile, FOPEN_READTEXT);
if(!fp)
warnf(config->global, "Cannot read from %s: %s\n", hdrfile,
warnf(config->global, "Cannot read from %s: %s", hdrfile,
strerror(errno));
else {
int i = read_field_headers(config, hdrfile, fp, &headers);
@ -620,7 +620,7 @@ static int get_param_part(struct OperationConfig *config, char endchar,
sep = *p;
*endpos = '\0';
if(*unknown)
warnf(config->global, "skip unknown form field: %s\n", unknown);
warnf(config->global, "skip unknown form field: %s", unknown);
}
}
@ -631,25 +631,25 @@ static int get_param_part(struct OperationConfig *config, char endchar,
if(ptype)
*ptype = type;
else if(type)
warnf(config->global, "Field content type not allowed here: %s\n", type);
warnf(config->global, "Field content type not allowed here: %s", type);
if(pfilename)
*pfilename = filename;
else if(filename)
warnf(config->global,
"Field file name not allowed here: %s\n", filename);
"Field file name not allowed here: %s", filename);
if(pencoder)
*pencoder = encoder;
else if(encoder)
warnf(config->global,
"Field encoder not allowed here: %s\n", encoder);
"Field encoder not allowed here: %s", encoder);
if(pheaders)
*pheaders = headers;
else if(headers) {
warnf(config->global,
"Field headers not allowed here: %s\n", headers->data);
"Field headers not allowed here: %s", headers->data);
curl_slist_free_all(headers);
}
@ -772,7 +772,7 @@ int formparse(struct OperationConfig *config,
else if(!name && !strcmp(contp, ")") && !literal_value) {
/* Ending a multipart. */
if(*mimecurrent == *mimeroot) {
warnf(config->global, "no multipart to terminate!\n");
warnf(config->global, "no multipart to terminate!");
goto fail;
}
*mimecurrent = (*mimecurrent)->parent;
@ -818,7 +818,7 @@ int formparse(struct OperationConfig *config,
libcurl. */
if(part->size > 0) {
warnf(config->global,
"error while reading standard input\n");
"error while reading standard input");
goto fail;
}
Curl_safefree(part->data);
@ -855,7 +855,7 @@ int formparse(struct OperationConfig *config,
libcurl. */
if(part->size > 0) {
warnf(config->global,
"error while reading standard input\n");
"error while reading standard input");
goto fail;
}
Curl_safefree(part->data);
@ -888,7 +888,7 @@ int formparse(struct OperationConfig *config,
if(sep) {
*contp = (char) sep;
warnf(config->global,
"garbage at end of field specification: %s\n", contp);
"garbage at end of field specification: %s", contp);
}
}
@ -896,7 +896,7 @@ int formparse(struct OperationConfig *config,
SET_TOOL_MIME_PTR(part, name);
}
else {
warnf(config->global, "Illegally formatted input field!\n");
warnf(config->global, "Illegally formatted input field!");
goto fail;
}
err = 0;