From: Sage Weil Date: Fri, 14 Oct 2016 19:35:33 +0000 (-0400) Subject: os/bluestore: fix escaping of odd chars >0x80 in keys X-Git-Tag: v11.1.0~620^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=a86d78ee6509bd09c695213fe996c50620eb6b8a;p=ceph.git os/bluestore: fix escaping of odd chars >0x80 in keys Signed-off-by: Sage Weil --- diff --git a/src/os/bluestore/BlueStore.cc b/src/os/bluestore/BlueStore.cc index aefa266ed219..336b1f8cdf58 100644 --- a/src/os/bluestore/BlueStore.cc +++ b/src/os/bluestore/BlueStore.cc @@ -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);