summaryrefslogtreecommitdiff
path: root/src/tool_getparam.c
diff options
context:
space:
mode:
authorMarian Klymov <nekto1989@gmail.com>2018-06-02 23:52:56 +0300
committerDaniel Stenberg <daniel@haxx.se>2018-06-11 11:14:48 +0200
commitc45360d4633850839bb9c2d77dbf8a8285e9ad49 (patch)
tree20159c553a74ed98c2431fc8f2852067f79ac4e9 /src/tool_getparam.c
parent38203f1585da53e07e54e37c7d5da4d72f509a2e (diff)
downloadcurl-c45360d4633850839bb9c2d77dbf8a8285e9ad49.tar.gz
cppcheck: fix warnings
- Get rid of variable that was generating false positive warning (unitialized) - Fix issues in tests - Reduce scope of several variables all over etc Closes #2631
Diffstat (limited to 'src/tool_getparam.c')
-rw-r--r--src/tool_getparam.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/tool_getparam.c b/src/tool_getparam.c
index 186168252..cc3fcf3a5 100644
--- a/src/tool_getparam.c
+++ b/src/tool_getparam.c
@@ -506,8 +506,7 @@ ParameterError getparameter(const char *flag, /* f or -long-flag */
*usedarg = FALSE; /* default is that we don't use the arg */
- if(('-' != flag[0]) ||
- (('-' == flag[0]) && ('-' == flag[1]))) {
+ if(('-' != flag[0]) || ('-' == flag[1])) {
/* this should be a long name */
const char *word = ('-' == flag[0]) ? flag + 2 : flag;
size_t fnam = strlen(word);
@@ -2155,7 +2154,6 @@ ParameterError parse_args(struct GlobalConfig *config, int argc,
orig_opt = argv[i];
if(stillflags && ('-' == argv[i][0])) {
- char *nextarg;
bool passarg;
char *flag = argv[i];
@@ -2164,7 +2162,7 @@ ParameterError parse_args(struct GlobalConfig *config, int argc,
following (URL) argument to start with -. */
stillflags = FALSE;
else {
- nextarg = (i < (argc - 1)) ? argv[i + 1] : NULL;
+ char *nextarg = (i < (argc - 1)) ? argv[i + 1] : NULL;
result = getparameter(flag, nextarg, &passarg, config, operation);
if(result == PARAM_NEXT_OPERATION) {