Unverified Commit 120d963a authored by Daniel Stenberg's avatar Daniel Stenberg
Browse files

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

Closes #1936
parent a69a4d22
Loading
Loading
Loading
Loading
+17 −17
Original line number Diff line number Diff line
@@ -241,11 +241,11 @@ void Curl_infof(struct Curl_easy *data, const char *fmt, ...)

void Curl_failf(struct Curl_easy *data, const char *fmt, ...)
{
  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);

@@ -258,9 +258,9 @@ void Curl_failf(struct Curl_easy *data, const char *fmt, ...)
      error[++len] = '\0';
      Curl_debug(data, CURLINFO_TEXT, error, len, NULL);
    }

    va_end(ap);
  }
}

/* Curl_sendf() sends formatted data to the server */
CURLcode Curl_sendf(curl_socket_t sockfd, struct connectdata *conn,