aboutsummaryrefslogtreecommitdiff
path: root/gdb/cli
diff options
context:
space:
mode:
authorTom Tromey <tromey@redhat.com>2008-07-30 01:10:17 +0000
committerTom Tromey <tromey@redhat.com>2008-07-30 01:10:17 +0000
commit22ad7fee2a313665df38ad7177f962f7c13ad0b6 (patch)
tree02be961e966cc0f9a72012c8b4cbd5be6b22964d /gdb/cli
parentd5529a849eb02c5aaea8ad808aa18a5d33089df0 (diff)
downloadgdb-22ad7fee2a313665df38ad7177f962f7c13ad0b6.zip
gdb-22ad7fee2a313665df38ad7177f962f7c13ad0b6.tar.gz
gdb-22ad7fee2a313665df38ad7177f962f7c13ad0b6.tar.bz2
* cli/cli-decode.c (lookup_cmd_1): Use memcpy.
(lookup_cmd_composition): Likewise.
Diffstat (limited to 'gdb/cli')
-rw-r--r--gdb/cli/cli-decode.c12
1 files changed, 2 insertions, 10 deletions
diff --git a/gdb/cli/cli-decode.c b/gdb/cli/cli-decode.c
index 6908314..5b1a7e0 100644
--- a/gdb/cli/cli-decode.c
+++ b/gdb/cli/cli-decode.c
@@ -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. */