Remove use of alloca.
[deliverable/binutils-gdb.git] / gas / remap.c
index 5f7b49eae4e8d219e551693427b9e13d7f175992..87eda013289480850812d8c357df76208ee3c79d 100644 (file)
@@ -73,19 +73,13 @@ const char *
 remap_debug_filename (const char *filename)
 {
   debug_prefix_map *map;
-  char *s;
-  const char *name;
-  size_t name_len;
 
   for (map = debug_prefix_maps; map; map = map->next)
     if (filename_ncmp (filename, map->old_prefix, map->old_len) == 0)
-      break;
-  if (!map)
-    return xstrdup (filename);
-  name = filename + map->old_len;
-  name_len = strlen (name) + 1;
-  s = (char *) alloca (name_len + map->new_len);
-  memcpy (s, map->new_prefix, map->new_len);
-  memcpy (s + map->new_len, name, name_len);
-  return xstrdup (s);
+      {
+       const char *name = filename + map->old_len;
+       return concat (map->new_prefix, name, NULL);
+      }
+       
+  return xstrdup (filename);
 }
This page took 0.024163 seconds and 4 git commands to generate.