urlapi: fix part of conditional expression is always true: qlen

Closes #10408
This commit is contained in:
Pronyushkin Petr 2023-02-03 11:35:15 +05:00 committed by Daniel Stenberg
parent 690c43b3ee
commit 2b46ce0313
No known key found for this signature in database
GPG Key ID: 5CC908FDB71E12C2

View File

@ -1157,7 +1157,7 @@ static CURLUcode parseurl(const char *url, CURLU *u, unsigned int flags)
size_t qlen = strlen(query) - fraglen; /* includes '?' */
pathlen = strlen(path) - qlen - fraglen;
if(qlen > 1) {
if(qlen && (flags & CURLU_URLENCODE)) {
if(flags & CURLU_URLENCODE) {
struct dynbuf enc;
Curl_dyn_init(&enc, CURL_MAX_INPUT_LENGTH);
/* skip the leading question mark */