diff options
Diffstat (limited to 'gdb/mi/mi-parse.c')
-rw-r--r-- | gdb/mi/mi-parse.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/gdb/mi/mi-parse.c b/gdb/mi/mi-parse.c index 1e11c59..92efe26 100644 --- a/gdb/mi/mi-parse.c +++ b/gdb/mi/mi-parse.c @@ -165,7 +165,7 @@ mi_parse_argv (const char *args, struct mi_parse *parse) return; } /* Create the buffer and copy characters in. */ - arg = xmalloc ((len + 1) * sizeof (char)); + arg = XNEWVEC (char, len + 1); chp = start; len = 0; while (*chp != '\0' && *chp != '"') @@ -195,14 +195,14 @@ mi_parse_argv (const char *args, struct mi_parse *parse) chp++; } len = chp - start; - arg = xmalloc ((len + 1) * sizeof (char)); + arg = XNEWVEC (char, len + 1); strncpy (arg, start, len); arg[len] = '\0'; break; } } /* Append arg to argv. */ - argv = xrealloc (argv, (argc + 2) * sizeof (char *)); + argv = XRESIZEVEC (char *, argv, argc + 2); argv[argc++] = arg; argv[argc] = NULL; } @@ -254,7 +254,7 @@ mi_parse (const char *cmd, char **token) /* Find/skip any token and then extract it. */ for (chp = cmd; *chp >= '0' && *chp <= '9'; chp++) ; - *token = xmalloc (chp - cmd + 1); + *token = (char *) xmalloc (chp - cmd + 1); memcpy (*token, cmd, (chp - cmd)); (*token)[chp - cmd] = '\0'; @@ -276,7 +276,7 @@ mi_parse (const char *cmd, char **token) for (; *chp && !isspace (*chp); chp++) ; - parse->command = xmalloc (chp - tmp + 1); + parse->command = (char *) xmalloc (chp - tmp + 1); memcpy (parse->command, tmp, chp - tmp); parse->command[chp - tmp] = '\0'; } |