Unverified Commit bec50cc2 authored by Daniel Stenberg's avatar Daniel Stenberg
Browse files

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
parent e239eda3
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -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';