From 82b16055af1d0654de4202d80e2d41d5120a23f9 Mon Sep 17 00:00:00 2001 From: Justin Cohen Date: Wed, 8 Jun 2022 13:37:42 -0400 Subject: [PATCH] Remove usage of sprintf in dwarf_cfi_to_module. sprintf is marked as deprecated with Xcode 14. Bug: 1331345 Change-Id: Ic301134ec0c5e7b9ee9d590ab1423491aad5ccf7 Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/3692036 Reviewed-by: Ivan Penkov Reviewed-by: Mike Frysinger --- src/common/dwarf_cfi_to_module.cc | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/common/dwarf_cfi_to_module.cc b/src/common/dwarf_cfi_to_module.cc index d7d19834..739b9fe0 100644 --- a/src/common/dwarf_cfi_to_module.cc +++ b/src/common/dwarf_cfi_to_module.cc @@ -184,9 +184,7 @@ string DwarfCFIToModule::RegisterName(int i) { return register_names_[reg]; reporter_->UnnamedRegister(entry_offset_, reg); - char buf[30]; - sprintf(buf, "unnamed_register%u", reg); - return buf; + return string("unnamed_register") + std::to_string(reg); } void DwarfCFIToModule::Record(Module::Address address, int reg,