]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
os/kstore: fix escaping of chars > 0x80 in keys 11502/head
authorSage Weil <sage@redhat.com>
Fri, 14 Oct 2016 19:35:58 +0000 (15:35 -0400)
committerSage Weil <sage@redhat.com>
Mon, 17 Oct 2016 15:46:22 +0000 (11:46 -0400)
Signed-off-by: Sage Weil <sage@redhat.com>
src/os/kstore/KStore.cc

index 31af5c2755173e3cddcbedc5fa6d6a9b0f7c00aa..e4498192fd427262b1cb4a14a11d00ce957f2cdc 100755 (executable)
@@ -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);