Simplify print_sys_errmsg
[deliverable/binutils-gdb.git] / gdb / utils.c
index e06eeddeeff9b47c034b11a10e7ffa4bbc074ea9..f7fae35729b7cfb4d4573b68616a174b1fba66c5 100644 (file)
@@ -629,15 +629,10 @@ void
 print_sys_errmsg (const char *string, int errcode)
 {
   const char *err = safe_strerror (errcode);
-  char *combined = (char *) alloca (strlen (err) + strlen (string) + 3);
-  strcpy (combined, string);
-  strcat (combined, ": ");
-  strcat (combined, err);
-
   /* We want anything which was printed on stdout to come out first, before
      this message.  */
   gdb_flush (gdb_stdout);
-  fprintf_unfiltered (gdb_stderr, "%s.\n", combined);
+  fprintf_unfiltered (gdb_stderr, "%s: %s.\n", string, err);
 }
 
 /* Control C eventually causes this to be called, at a convenient time.  */
This page took 0.025217 seconds and 4 git commands to generate.