From c05dd51122c2d654031b04e02ad0ea5b53ffe5e2 Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Thu, 21 Mar 2024 11:15:56 -0600 Subject: Use std::string for disassembler options I noticed that the disassembler_options code uses manual memory management. It seemed simpler to replace this with std::string. Approved-By: John Baldwin --- gdb/arch-utils.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'gdb/arch-utils.c') diff --git a/gdb/arch-utils.c b/gdb/arch-utils.c index ae3354f..d404d1f 100644 --- a/gdb/arch-utils.c +++ b/gdb/arch-utils.c @@ -1156,11 +1156,11 @@ pstring (const char *string) } static const char * -pstring_ptr (char **string) +pstring_ptr (std::string *string) { - if (string == NULL || *string == NULL) + if (string == nullptr) return "(null)"; - return *string; + return string->c_str (); } /* Helper function to print a list of strings, represented as "const -- cgit v1.1