Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

failf: skip the sprintf() if there are no consumers #1936

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter...
Filter file types
Jump to…
Jump to file or symbol
Failed to load files and symbols.

Always

Just for now

@@ -241,25 +241,25 @@ void Curl_infof(struct Curl_easy *data, const char *fmt, ...)

void Curl_failf(struct Curl_easy *data, const char *fmt, ...)
{
va_list ap;
size_t len;
char error[CURL_ERROR_SIZE + 2];
va_start(ap, fmt);

vsnprintf(error, CURL_ERROR_SIZE, fmt, ap);
len = strlen(error);
if(data->set.verbose || data->set.errorbuffer) {
va_list ap;
size_t len;
char error[CURL_ERROR_SIZE + 2];
va_start(ap, fmt);
vsnprintf(error, CURL_ERROR_SIZE, fmt, ap);
len = strlen(error);

if(data->set.errorbuffer && !data->state.errorbuf) {
strcpy(data->set.errorbuffer, error);
data->state.errorbuf = TRUE; /* wrote error string */
}
if(data->set.verbose) {
error[len] = '\n';
error[++len] = '\0';
Curl_debug(data, CURLINFO_TEXT, error, len, NULL);
if(data->set.errorbuffer && !data->state.errorbuf) {
strcpy(data->set.errorbuffer, error);
data->state.errorbuf = TRUE; /* wrote error string */
}
if(data->set.verbose) {
error[len] = '\n';
error[++len] = '\0';
Curl_debug(data, CURLINFO_TEXT, error, len, NULL);
}
va_end(ap);
}

va_end(ap);
}

/* Curl_sendf() sends formatted data to the server */
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.