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

tool_cb_wrt: fix variable shadowing warning #1661

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/tool_cb_wrt.c
Expand Up @@ -78,7 +78,7 @@ size_t tool_write_cb(char *buffer, size_t sz, size_t nmemb, void *userdata)
struct OutStruct *outs = userdata;
struct OperationConfig *config = outs->config;
size_t bytes = sz * nmemb;
bool isatty = config->global->isatty;
bool is_tty = config->global->isatty;

/*
* Once that libcurl has called back tool_write_cb() the returned value
Expand All @@ -92,7 +92,7 @@ size_t tool_write_cb(char *buffer, size_t sz, size_t nmemb, void *userdata)
{
char *tty = curlx_getenv("CURL_ISATTY");
if(tty) {
isatty = TRUE;
is_tty = TRUE;
curl_free(tty);
}
}
Expand Down Expand Up @@ -144,7 +144,7 @@ size_t tool_write_cb(char *buffer, size_t sz, size_t nmemb, void *userdata)
if(!outs->stream && !tool_create_output_file(outs))
return failure;

if(isatty && (outs->bytes < 2000) && !config->terminal_binary_ok) {
if(is_tty && (outs->bytes < 2000) && !config->terminal_binary_ok) {
/* binary output to terminal? */
if(memchr(buffer, 0, bytes)) {
warnf(config->global, "Binary output can mess up your terminal. "
Expand Down