mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-22 11:00:01 +08:00
* cli/cli-setshow.c (do_setshow_command): Use dynamically sized buffer
to construct error message if no argument was supplied.
This commit is contained in:
@ -1,3 +1,8 @@
|
|||||||
|
2007-11-16 Ulrich Weigand <uweigand@de.ibm.com>
|
||||||
|
|
||||||
|
* cli/cli-setshow.c (do_setshow_command): Use dynamically sized buffer
|
||||||
|
to construct error message if no argument was supplied.
|
||||||
|
|
||||||
2007-11-16 Ulrich Weigand <uweigand@de.ibm.com>
|
2007-11-16 Ulrich Weigand <uweigand@de.ibm.com>
|
||||||
|
|
||||||
* i386nbsd-tdep.c (i386nbsd_aout_supply_regset): Remove.
|
* i386nbsd-tdep.c (i386nbsd_aout_supply_regset): Remove.
|
||||||
|
@ -242,16 +242,22 @@ do_setshow_command (char *arg, int from_tty, struct cmd_list_element *c)
|
|||||||
/* if no argument was supplied, print an informative error message */
|
/* if no argument was supplied, print an informative error message */
|
||||||
if (arg == NULL)
|
if (arg == NULL)
|
||||||
{
|
{
|
||||||
char msg[1024];
|
char *msg;
|
||||||
strcpy (msg, "Requires an argument. Valid arguments are ");
|
int msg_len = 0;
|
||||||
|
for (i = 0; c->enums[i]; i++)
|
||||||
|
msg_len += strlen (c->enums[i]) + 2;
|
||||||
|
|
||||||
|
msg = xmalloc (msg_len);
|
||||||
|
*msg = '\0';
|
||||||
|
make_cleanup (xfree, msg);
|
||||||
|
|
||||||
for (i = 0; c->enums[i]; i++)
|
for (i = 0; c->enums[i]; i++)
|
||||||
{
|
{
|
||||||
if (i != 0)
|
if (i != 0)
|
||||||
strcat (msg, ", ");
|
strcat (msg, ", ");
|
||||||
strcat (msg, c->enums[i]);
|
strcat (msg, c->enums[i]);
|
||||||
}
|
}
|
||||||
strcat (msg, ".");
|
error (_("Requires an argument. Valid arguments are %s."), msg);
|
||||||
error (("%s"), msg);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
p = strchr (arg, ' ');
|
p = strchr (arg, ' ');
|
||||||
|
Reference in New Issue
Block a user