diff options
author | Raphael Isemann <teemperor@gmail.com> | 2020-07-27 14:05:23 +0200 |
---|---|---|
committer | Raphael Isemann <teemperor@gmail.com> | 2020-07-27 14:27:54 +0200 |
commit | db203e0268479d16d36a318c726cce5a4a5f75a6 (patch) | |
tree | 73f5f308d72428ffc31eac5635276d4081966607 /lldb/source/Interpreter/CommandInterpreter.cpp | |
parent | 1ebcf03551c3136b8153d44968204c022f121ae6 (diff) | |
download | llvm-db203e0268479d16d36a318c726cce5a4a5f75a6.zip llvm-db203e0268479d16d36a318c726cce5a4a5f75a6.tar.gz llvm-db203e0268479d16d36a318c726cce5a4a5f75a6.tar.bz2 |
[lldb] Modernize away some snprintf calls
Reviewers: #lldb, JDevlieghere
Reviewed By: #lldb, JDevlieghere
Subscribers: JDevlieghere
Differential Revision: https://reviews.llvm.org/D84530
Diffstat (limited to 'lldb/source/Interpreter/CommandInterpreter.cpp')
-rw-r--r-- | lldb/source/Interpreter/CommandInterpreter.cpp | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/lldb/source/Interpreter/CommandInterpreter.cpp b/lldb/source/Interpreter/CommandInterpreter.cpp index 50a69b2..aca3654 100644 --- a/lldb/source/Interpreter/CommandInterpreter.cpp +++ b/lldb/source/Interpreter/CommandInterpreter.cpp @@ -1987,10 +1987,7 @@ void CommandInterpreter::BuildAliasCommandArgs(CommandObject *alias_cmd_obj, if (value_type != OptionParser::eOptionalArgument) new_args.AppendArgument(value); else { - char buffer[255]; - ::snprintf(buffer, sizeof(buffer), "%s%s", option.c_str(), - value.c_str()); - new_args.AppendArgument(llvm::StringRef(buffer)); + new_args.AppendArgument(option + value); } } else if (static_cast<size_t>(index) >= cmd_args.GetArgumentCount()) { @@ -2012,10 +2009,7 @@ void CommandInterpreter::BuildAliasCommandArgs(CommandObject *alias_cmd_obj, if (value_type != OptionParser::eOptionalArgument) new_args.AppendArgument(cmd_args.GetArgumentAtIndex(index)); else { - char buffer[255]; - ::snprintf(buffer, sizeof(buffer), "%s%s", option.c_str(), - cmd_args.GetArgumentAtIndex(index)); - new_args.AppendArgument(buffer); + new_args.AppendArgument(option + cmd_args.GetArgumentAtIndex(index)); } used[index] = true; } |