From 659da5f16d662c771632d927906516f3fbfdda1e Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Fri, 14 Oct 2016 15:35:58 -0400 Subject: [PATCH] os/kstore: fix escaping of chars > 0x80 in keys Signed-off-by: Sage Weil --- src/os/kstore/KStore.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/os/kstore/KStore.cc b/src/os/kstore/KStore.cc index 31af5c27551..e4498192fd4 100755 --- a/src/os/kstore/KStore.cc +++ b/src/os/kstore/KStore.cc @@ -84,10 +84,10 @@ static void append_escaped(const string &in, string *out) char hexbyte[8]; for (string::const_iterator i = in.begin(); i != in.end(); ++i) { if (*i <= '#') { - snprintf(hexbyte, sizeof(hexbyte), "#%02x", (unsigned)*i); + snprintf(hexbyte, sizeof(hexbyte), "#%02x", (uint8_t)*i); out->append(hexbyte); } else if (*i >= '~') { - snprintf(hexbyte, sizeof(hexbyte), "~%02x", (unsigned)*i); + snprintf(hexbyte, sizeof(hexbyte), "~%02x", (uint8_t)*i); out->append(hexbyte); } else { out->push_back(*i); -- 2.47.3