tool_paramhlp: fix "enumerated type mixed with another type"

Warning by icc

Closes #9179
This commit is contained in:
Daniel Stenberg 2022-07-21 00:26:29 +02:00
parent ddfd41c9b2
commit 0bb842a587
No known key found for this signature in database
GPG Key ID: 5CC908FDB71E12C2

View File

@ -314,11 +314,11 @@ ParameterError proto2num(struct OperationConfig *config,
};
if(!str)
return 1;
return PARAM_OPTION_AMBIGUOUS;
buffer = strdup(str); /* because strtok corrupts it */
if(!buffer)
return 1;
return PARAM_NO_MEM;
/* Allow strtok() here since this isn't used threaded */
/* !checksrc! disable BANNEDFUNC 2 */
@ -341,7 +341,7 @@ ParameterError proto2num(struct OperationConfig *config,
break;
default: /* Includes case of terminating NULL */
Curl_safefree(buffer);
return 1;
return PARAM_BAD_USE;
}
}