tool_paramhlp: Fixed compilation warnings

declaration of 'index' shadows a global declaration
This commit is contained in:
Steve Holme 2014-02-20 23:18:48 +00:00
parent 873178a657
commit 3521e4e40d

View File

@ -366,9 +366,9 @@ ParameterError str2offset(curl_off_t *val, const char *str)
return PARAM_BAD_NUMERIC; return PARAM_BAD_NUMERIC;
} }
static CURLcode checkpasswd(const char *kind, /* for what purpose */ static CURLcode checkpasswd(const char *kind, /* for what purpose */
const size_t index, /* operation index */ const size_t i, /* operation index */
const bool last, /* TRUE if last operation */ const bool last, /* TRUE if last operation */
char **userpwd) /* pointer to allocated string */ char **userpwd) /* pointer to allocated string */
{ {
char *psep; char *psep;
@ -395,7 +395,7 @@ static CURLcode checkpasswd(const char *kind, /* for what purpose */
*osep = '\0'; *osep = '\0';
/* build a nice-looking prompt */ /* build a nice-looking prompt */
if(!index && last) if(!i && last)
curlx_msnprintf(prompt, sizeof(prompt), curlx_msnprintf(prompt, sizeof(prompt),
"Enter %s password for user '%s':", "Enter %s password for user '%s':",
kind, *userpwd); kind, *userpwd);
@ -403,7 +403,7 @@ static CURLcode checkpasswd(const char *kind, /* for what purpose */
curlx_msnprintf(prompt, sizeof(prompt), curlx_msnprintf(prompt, sizeof(prompt),
"Enter %s password for user '%s' on URL #%" "Enter %s password for user '%s' on URL #%"
CURL_FORMAT_CURL_OFF_TU ":", CURL_FORMAT_CURL_OFF_TU ":",
kind, *userpwd, index + 1); kind, *userpwd, i + 1);
/* get password */ /* get password */
getpass_r(prompt, passwd, sizeof(passwd)); getpass_r(prompt, passwd, sizeof(passwd));
@ -481,21 +481,21 @@ static char *my_useragent(void)
return strdup(CURL_NAME "/" CURL_VERSION); return strdup(CURL_NAME "/" CURL_VERSION);
} }
CURLcode get_args(struct Configurable *config, const size_t index) CURLcode get_args(struct Configurable *config, const size_t i)
{ {
CURLcode result = CURLE_OK; CURLcode result = CURLE_OK;
bool last = (config->next ? FALSE : TRUE); bool last = (config->next ? FALSE : TRUE);
/* Check we have a password for the given host user */ /* Check we have a password for the given host user */
if(config->userpwd && !config->xoauth2_bearer) { if(config->userpwd && !config->xoauth2_bearer) {
result = checkpasswd("host", index, last, &config->userpwd); result = checkpasswd("host", i, last, &config->userpwd);
if(result) if(result)
return result; return result;
} }
/* Check we have a password for the given proxy user */ /* Check we have a password for the given proxy user */
if(config->proxyuserpwd) { if(config->proxyuserpwd) {
result = checkpasswd("proxy", index, last, &config->proxyuserpwd); result = checkpasswd("proxy", i, last, &config->proxyuserpwd);
if(result) if(result)
return result; return result;
} }