]> granicus.if.org Git - curl/commitdiff
tool_paramhlp: Fixed display of URL index in password prompt for --next
authorSteve Holme <steve_holme@hotmail.com>
Fri, 27 Nov 2015 06:59:02 +0000 (06:59 +0000)
committerSteve Holme <steve_holme@hotmail.com>
Fri, 27 Nov 2015 06:59:02 +0000 (06:59 +0000)
Commit f3bae6ed73 added the URL index to the password prompt when using
--next. Unfortunately, because the size_t specifier (%zu) is not
supported by all sprintf() implementations we use the curl_off_t format
specifier instead. The display of an incorrect value arises on platforms
where size_t and curl_off_t are of a different size.

src/tool_paramhlp.c

index c26754aeb93a6d94016431e5e1595ceb6db7f24f..c1baed5f0fcdd501f90fddcaa14406b6e9c9f376 100644 (file)
@@ -426,7 +426,7 @@ static CURLcode checkpasswd(const char *kind, /* for what purpose */
       curlx_msnprintf(prompt, sizeof(prompt),
                       "Enter %s password for user '%s' on URL #%"
                       CURL_FORMAT_CURL_OFF_TU ":",
-                      kind, *userpwd, i + 1);
+                      kind, *userpwd, (curl_off_t) (i + 1));
 
     /* get password */
     getpass_r(prompt, passwd, sizeof(passwd));