]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
os/bluestore: fix escaping of odd chars >0x80 in keys
authorSage Weil <sage@redhat.com>
Fri, 14 Oct 2016 19:35:33 +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/bluestore/BlueStore.cc

index aefa266ed21999749093fba4d14438920c26ad20..336b1f8cdf5827d94080efd29b5e0d175a88b61d 100644 (file)
@@ -114,10 +114,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);