diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/tool_cb_dbg.c | 2 | ||||
-rw-r--r-- | src/tool_cb_rea.c | 8 | ||||
-rw-r--r-- | src/tool_getparam.c | 13 |
3 files changed, 14 insertions, 9 deletions
diff --git a/src/tool_cb_dbg.c b/src/tool_cb_dbg.c index 0b36236ab..6a587cc1c 100644 --- a/src/tool_cb_dbg.c +++ b/src/tool_cb_dbg.c @@ -91,7 +91,7 @@ int tool_debug_cb(CURL *handle, curl_infotype type, char idsbuf[60]; curl_off_t xfer_id, conn_id; - (void)handle; /* not used */ + (void)handle; (void)userdata; if(global->tracetime) { diff --git a/src/tool_cb_rea.c b/src/tool_cb_rea.c index 5b8ba62a5..0a3e9ef0e 100644 --- a/src/tool_cb_rea.c +++ b/src/tool_cb_rea.c @@ -146,10 +146,10 @@ int tool_readbusy_cb(void *clientp, struct OperationConfig *config = per->config; static curl_off_t ulprev; - (void)dltotal; /* unused */ - (void)dlnow; /* unused */ - (void)ultotal; /* unused */ - (void)ulnow; /* unused */ + (void)dltotal; + (void)dlnow; + (void)ultotal; + (void)ulnow; if(config->readbusy) { if(ulprev == ulnow) { diff --git a/src/tool_getparam.c b/src/tool_getparam.c index 165a4bfb6..6be57dbd5 100644 --- a/src/tool_getparam.c +++ b/src/tool_getparam.c @@ -2808,6 +2808,12 @@ static ParameterError opt_filestring(struct OperationConfig *config, return err; } +/* detect e2 80 80 - e2 80 ff */ +static bool has_leading_unicode(const unsigned char *arg) +{ + return ((arg[0] == 0xe2) && (arg[1] == 0x80) && (arg[2] & 0x80)); +} + /* the longest command line option, excluding the leading -- */ #define MAX_OPTION_LEN 26 @@ -2947,10 +2953,9 @@ ParameterError getparameter(const char *flag, /* f or -long-flag */ warnf("The filename argument '%s' looks like a flag.", nextarg); } - else if(!strncmp("\xe2\x80\x9c", nextarg, 3)) { - warnf("The argument '%s' starts with a Unicode quote where " - "maybe an ASCII \" was intended?", - nextarg); + else if(has_leading_unicode((const unsigned char *)nextarg)) { + warnf("The argument '%s' starts with a Unicode character. " + "Maybe ASCII was intended?", nextarg); } /* ARG_FILE | ARG_STRG */ err = opt_filestring(config, a, nextarg); |