mirror of
https://github.com/moparisthebest/curl
synced 2024-12-21 23:58:49 -05:00
when sending an error message to the debugfunction, we append a newline so
that the output looks better
This commit is contained in:
parent
0f34521612
commit
d0cffdec5d
16
lib/sendf.c
16
lib/sendf.c
@ -154,9 +154,19 @@ void Curl_failf(struct SessionHandle *data, const char *fmt, ...)
|
|||||||
vsnprintf(data->set.errorbuffer, CURL_ERROR_SIZE, fmt, ap);
|
vsnprintf(data->set.errorbuffer, CURL_ERROR_SIZE, fmt, ap);
|
||||||
data->state.errorbuf = TRUE; /* wrote error string */
|
data->state.errorbuf = TRUE; /* wrote error string */
|
||||||
|
|
||||||
if(data->set.verbose)
|
if(data->set.verbose) {
|
||||||
Curl_debug(data, CURLINFO_TEXT, data->set.errorbuffer,
|
int len = strlen(data->set.errorbuffer);
|
||||||
strlen(data->set.errorbuffer));
|
bool doneit=FALSE;
|
||||||
|
if(len < CURL_ERROR_SIZE) {
|
||||||
|
doneit = TRUE;
|
||||||
|
data->set.errorbuffer[len] = '\n';
|
||||||
|
data->set.errorbuffer[++len] = '\0';
|
||||||
|
}
|
||||||
|
Curl_debug(data, CURLINFO_TEXT, data->set.errorbuffer, len);
|
||||||
|
if(doneit)
|
||||||
|
/* cut off the newline again */
|
||||||
|
data->set.errorbuffer[--len]=0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
va_end(ap);
|
va_end(ap);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user