diff --git a/db/filename.cc b/db/filename.cc index b649628a9b..f47855289c 100644 --- a/db/filename.cc +++ b/db/filename.cc @@ -46,13 +46,10 @@ extern Status WriteStringToFileSync(Env* env, const Slice& data, static std::string MakeFileName(const std::string& name, uint64_t number, const char* suffix) { char buf[100]; - snprintf(buf, sizeof(buf), "%06llu.%s", + snprintf(buf, sizeof(buf), "/%06llu.%s", static_cast(number), suffix); - if (name.empty()) { - return buf; - } - return name + "/" + buf; + return name + buf; } std::string LogFileName(const std::string& name, uint64_t number) {