inf-ptrace: Do not stop memory transfers after a single word
[deliverable/binutils-gdb.git] / gas / macro.c
index 615bfdae4fdd137a210ed7a8325cffa29f7b16ca..6eb62132337bca8ebc1872ffa1ffe510c1737fd3 100644 (file)
@@ -1,5 +1,5 @@
 /* macro.c - macro support for gas
-   Copyright (C) 1994-2016 Free Software Foundation, Inc.
+   Copyright (C) 1994-2017 Free Software Foundation, Inc.
 
    Written by Steve and Judy Chamberlain of Cygnus Support,
       sac@cygnus.com
@@ -404,7 +404,7 @@ get_any_string (size_t idx, sb *in, sb *out)
        }
       else
        {
-         char *br_buf = (char *) xmalloc (1);
+         char *br_buf = XNEWVEC (char, 1);
          char *in_br = br_buf;
 
          *in_br = '\0';
@@ -438,7 +438,7 @@ get_any_string (size_t idx, sb *in, sb *out)
                    --in_br;
                  else
                    {
-                     br_buf = (char *) xmalloc (strlen (in_br) + 2);
+                     br_buf = XNEWVEC (char, strlen (in_br) + 2);
                      strcpy (br_buf + 1, in_br);
                      free (in_br);
                      in_br = br_buf;
@@ -815,7 +815,7 @@ macro_expand_body (sb *in, sb *out, formal_entry *formals,
            }
          else
            {
-             /* Permit macro parameter substition delineated with
+             /* Permit macro parameter substitution delineated with
                 an '&' prefix and optional '&' suffix.  */
              src = sub_actual (src + 1, in, &t, formal_hash, '&', out, 0);
            }
@@ -842,7 +842,7 @@ macro_expand_body (sb *in, sb *out, formal_entry *formals,
            {
              /* Sub in the macro invocation number.  */
 
-             char buffer[10];
+             char buffer[12];
              src++;
              sprintf (buffer, "%d", macro_number);
              sb_add_string (out, buffer);
@@ -1250,9 +1250,7 @@ check_macro (const char *line, sb *expand,
   if (is_name_ender (*s))
     ++s;
 
-  copy = (char *) xmalloc (s - line + 1);
-  memcpy (copy, line, s - line);
-  copy[s - line] = '\0';
+  copy = xmemdup0 (line, s - line);
   for (cls = copy; *cls != '\0'; cls ++)
     *cls = TOLOWER (*cls);
 
@@ -1289,7 +1287,7 @@ delete_macro (const char *name)
   macro_entry *macro;
 
   len = strlen (name);
-  copy = (char *) xmalloc (len + 1);
+  copy = XNEWVEC (char, len + 1);
   for (i = 0; i < len; ++i)
     copy[i] = TOLOWER (name[i]);
   copy[i] = '\0';
@@ -1303,7 +1301,7 @@ delete_macro (const char *name)
       free_macro (macro);
     }
   else
-    as_warn (_("Attempt to purge non-existant macro `%s'"), copy);
+    as_warn (_("Attempt to purge non-existing macro `%s'"), copy);
   free (copy);
 }
 
This page took 0.038437 seconds and 4 git commands to generate.