This is not a good function and it should be revisisted later.
Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
strcasecmp(s, "1") == 0);
}
-static inline void append_rand_alpha(CephContext *cct, const std::string& src, std::string& dest, int len)
+inline void
+append_rand_alpha(
+ CephContext* cct,
+ const std::string& src,
+ std::string& dest,
+ int len)
{
- dest = src;
- char buf[len + 1];
- gen_rand_alphanumeric(cct, buf, len);
- dest.append("_");
- dest.append(buf);
+ dest = fmt::format("{}_{}", src, gen_rand_alphanumeric(cct, len));
}
static inline uint64_t rgw_rounded_kb(uint64_t bytes)