summaryrefslogtreecommitdiff
path: root/util.c
diff options
context:
space:
mode:
authorJoe Orton <jorton@redhat.com>2017-02-15 09:30:06 +0000
committerdormando <dormando@rydia.net>2017-02-26 10:18:19 -0800
commit64bbbf4c7655a540247db4b608b00f809742f24b (patch)
tree6dfe43a24f04a2245e9fecee94f285f16acdb6b4 /util.c
parentdc5f65d38a4c8f8b51e0dace323374ec76fcc647 (diff)
downloadmemcached-64bbbf4c7655a540247db4b608b00f809742f24b.tar.gz
Print with more-restricted format string to fix compiler warning
with gcc 7's -Wformat-truncation.
Diffstat (limited to 'util.c')
-rw-r--r--util.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/util.c b/util.c
index f6a3d91..0ccbe4d 100644
--- a/util.c
+++ b/util.c
@@ -18,7 +18,7 @@ void uriencode_init(void) {
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 */
}