Use obstack_strdup more
[deliverable/binutils-gdb.git] / gdb / c-exp.y
index 47e82b698b418e467f114b03dc1400c0a3e297a7..439a72a10de426d4e8cbf853178b4baef0720411 100644 (file)
@@ -2490,15 +2490,14 @@ static const struct token ident_tokens[] =
 static void
 scan_macro_expansion (char *expansion)
 {
-  char *copy;
+  const char *copy;
 
   /* We'd better not be trying to push the stack twice.  */
   gdb_assert (! cpstate->macro_original_text);
 
   /* Copy to the obstack, and then free the intermediate
      expansion.  */
-  copy = (char *) obstack_copy0 (&cpstate->expansion_obstack, expansion,
-                                strlen (expansion));
+  copy = obstack_strdup (&cpstate->expansion_obstack, expansion);
   xfree (expansion);
 
   /* Save the old lexptr value, so we can return to it when we're done
This page took 0.02508 seconds and 4 git commands to generate.