memcached/memcached-1.4.34-gcc7fmt.patch
2017-02-15 09:26:22 +00:00

16 lines
542 B
Diff

gcc -Wformat-truncation thinks this might truncate.
diff -uap memcached-1.4.34/util.c.gcc7fmt memcached-1.4.34/util.c
--- memcached-1.4.34/util.c.gcc7fmt
+++ memcached-1.4.34/util.c
@@ -18,7 +18,7 @@
if (isalnum(x) || x == '-' || x == '.' || x == '_' || x == '~') {
uriencode_map[x] = NULL;
} else {
- snprintf(str, 4, "%%%02X", x);
+ snprintf(str, 4, "%%%02hhX", (unsigned char)x);
uriencode_map[x] = str;
str += 3; /* lobbing off the \0 is fine */
}