mprintf: remove strlen calls on empty strings in dprintf_formatf

Turns out that in dprintf_formatf we did a strlen on empty strings, a
bit strange is how common this actually is, 24 alone when doing a simple
GET from https://curl.se

Closes #8427
This commit is contained in:
Henrik Holst 2022-02-10 18:47:08 +01:00 committed by Daniel Stenberg
parent e1667a61ea
commit 186340c9cd
No known key found for this signature in database
GPG Key ID: 5CC908FDB71E12C2

View File

@ -829,6 +829,8 @@ static int dprintf_formatf(
}
else if(prec != -1)
len = (size_t)prec;
else if(*str == '\0')
len = 0;
else
len = strlen(str);