Eliminate call to StringPrintf() with non-constexpr format string.

Bug: 1371963
Change-Id: Ic3cc2010e48c399de8d19b94c3b515b53e2d18a3
Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/4953795
Commit-Queue: Peter Kasting <pkasting@chromium.org>
Reviewed-by: Mark Mentovai <mark@chromium.org>
This commit is contained in:
Peter Kasting 2023-10-18 14:16:23 -07:00 committed by Crashpad LUCI CQ
parent b6d3cdcc4d
commit 376e8c0e69

View File

@ -34,8 +34,8 @@
#include "base/logging.h"
#include "base/posix/eintr_wrapper.h"
#include "base/scoped_generic.h"
#include "base/strings/strcat.h"
#include "base/strings/string_piece.h"
#include "base/strings/stringprintf.h"
#include "base/strings/sys_string_conversions.h"
#include "client/settings.h"
#include "util/file/directory_reader.h"
@ -116,9 +116,9 @@ bool CreateOrEnsureDirectoryExists(const base::FilePath& path) {
// have changed, and new_name determines whether the returned xattr name will be
// the old name or its new equivalent.
std::string XattrNameInternal(const base::StringPiece& name, bool new_name) {
return base::StringPrintf(new_name ? "org.chromium.crashpad.database.%s"
: "com.googlecode.crashpad.%s",
name.data());
return base::StrCat({new_name ? "org.chromium.crashpad.database."
: "com.googlecode.crashpad.",
name});
}
} // namespace