From: Ben Greear <[email protected]>

I guess the compiler is lame, but the end code should be similar
either way.  This fixes the warning:

cc1: warnings being treated as errors
mime.c: In function 'escape_string':
mime.c:301:5: error: conversion to 'char' from 'int' may alter its value

[greearb@v-f14-64 ~]$ gcc --version
gcc (GCC) 4.5.1 20100924 (Red Hat 4.5.1-4)

Signed-off-by: Ben Greear <[email protected]>
---
 lib/mime.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/lib/mime.c b/lib/mime.c
index 514f6b2..5ed8849 100644
--- a/lib/mime.c
+++ b/lib/mime.c
@@ -298,7 +298,10 @@ static char *escape_string(const char *src, size_t len)
 
     if(c == '"' || c == '\\' || !c)
       dst[i++] = '\\';
-    dst[i++] = c? c: '0';
+    if(c)
+      dst[i++] = c;
+    else
+      dst[i++] = '0';
   }
 
   dst[i] = '\0';
-- 
2.7.5

-------------------------------------------------------------------
Unsubscribe: https://cool.haxx.se/list/listinfo/curl-library
Etiquette:   https://curl.haxx.se/mail/etiquette.html

Reply via email to