]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
rgw: Avoid signedness weirdness
authorAdam C. Emerson <aemerson@redhat.com>
Fri, 15 Mar 2019 19:22:05 +0000 (15:22 -0400)
committerAdam C. Emerson <aemerson@redhat.com>
Fri, 15 Mar 2019 19:22:05 +0000 (15:22 -0400)
If `char` is signed, then every `char` will be less than 255. Thus,
declare `e` as `unsigned char`.

Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
src/rgw/rgw_rados.cc

index 7ae743acadcc08c7499fcc5056a99b6ed836e177..0c5e9ceba49c9a0b454f724408502121e32c43d0 100644 (file)
@@ -2432,7 +2432,7 @@ int RGWRados::Bucket::update_bucket_id(const string& new_bucket_id)
 static inline std::string after_delim(std::string_view delim)
 {
   // assert: ! delim.empty()
-  char e = delim.back();
+  unsigned char e = delim.back();
   delim.remove_suffix(1);
   std::string result{delim.data(), delim.length()};
   if (e < 255) {