* cli/cli-decode.c (lookup_cmd_1): Use memcpy.
authorTom Tromey <tromey@redhat.com>
Wed, 30 Jul 2008 01:10:17 +0000 (01:10 +0000)
committerTom Tromey <tromey@redhat.com>
Wed, 30 Jul 2008 01:10:17 +0000 (01:10 +0000)
(lookup_cmd_composition): Likewise.

gdb/ChangeLog
gdb/cli/cli-decode.c

index 3267a30a698204cd24a38840852755c826e1936f..b00b374b2090633b67dac74f6442691c96d0057c 100644 (file)
@@ -1,3 +1,8 @@
+2008-07-29  Tom Tromey  <tromey@redhat.com>
+
+       * cli/cli-decode.c (lookup_cmd_1): Use memcpy.
+       (lookup_cmd_composition): Likewise.
+
 2008-07-29  Tom Tromey  <tromey@redhat.com>
 
        * cli/cli-cmds.c (edit_command): Remove unused variables.  Delete
index 690831466b935266ed0a7d7e09c422b4b530d4cd..5b1a7e08581ddeb41256845d5c81071ab96870dc 100644 (file)
@@ -1112,11 +1112,7 @@ lookup_cmd_1 (char **text, struct cmd_list_element *clist,
 
 
   command = (char *) alloca (len + 1);
-  for (tmp = 0; tmp < len; tmp++)
-    {
-      char x = (*text)[tmp];
-      command[tmp] = x;
-    }
+  memcpy (command, *text, len);
   command[len] = '\0';
 
   /* Look it up.  */
@@ -1468,11 +1464,7 @@ lookup_cmd_composition (char *text,
        it's length is len).  We copy this into a local temporary */
       
       command = (char *) alloca (len + 1);
-      for (tmp = 0; tmp < len; tmp++)
-      {
-        char x = text[tmp];
-        command[tmp] = x;
-      }
+      memcpy (command, text, len);
       command[len] = '\0';
       
       /* Look it up.  */