1
0
mirror of https://github.com/moparisthebest/curl synced 2024-12-21 15:48:49 -05:00

mime:escape_string minor clarification change

... as it also removes a warning with old gcc versions.

Bug: https://curl.haxx.se/mail/lib-2017-09/0049.html
Reported-by: Ben Greear
This commit is contained in:
Daniel Stenberg 2017-09-17 23:31:49 +02:00
parent e239eda39e
commit bec50cc285
No known key found for this signature in database
GPG Key ID: 5CC908FDB71E12C2

View File

@ -296,9 +296,12 @@ static char *escape_string(const char *src, size_t len)
for(i = 0; len; len--) {
char c = *src++;
if(c == '"' || c == '\\' || !c)
if(c == '"' || c == '\\' || !c) {
dst[i++] = '\\';
dst[i++] = c? c: '0';
if(!c)
c = '0';
}
dst[i++] = c;
}
dst[i] = '\0';