Change pid_to_str to return std::string
[deliverable/binutils-gdb.git] / gdb / linux-tdep.c
index 8d594138e5586a33bf4e0131b8126b905dbdc288..77bc7142865ea196a4d96c7ac3c2036e38deca6e 100644 (file)
@@ -414,16 +414,11 @@ linux_has_shared_address_space (struct gdbarch *gdbarch)
 
 /* This is how we want PTIDs from core files to be printed.  */
 
-static const char *
+static std::string
 linux_core_pid_to_str (struct gdbarch *gdbarch, ptid_t ptid)
 {
-  static char buf[80];
-
   if (ptid.lwp () != 0)
-    {
-      snprintf (buf, sizeof (buf), "LWP %ld", ptid.lwp ());
-      return buf;
-    }
+    return string_printf ("LWP %ld", ptid.lwp ());
 
   return normal_pid_to_str (ptid);
 }
This page took 0.025479 seconds and 4 git commands to generate.