mi/mi-cmd-break.c: Use xsnprintf instead of sprintf (ARI fix)

gdb/ChangeLog:

        * mi/mi-cmd-break.c (mi_argv_to_format): Use xsnprintf instead
        of sprintf.
This commit is contained in:
Joel Brobecker 2013-05-23 06:39:42 +00:00
parent 0201faace7
commit ce70887aa8
2 changed files with 7 additions and 1 deletions

View File

@ -1,3 +1,8 @@
2013-05-23 Joel Brobecker <brobecker@adacore.com>
* mi/mi-cmd-break.c (mi_argv_to_format): Use xsnprintf instead
of sprintf.
2013-05-22 Keith Seitz <keiths@redhat.com>
* ada-lang.c (is_known_support_routine): Add explicit free of

View File

@ -135,7 +135,8 @@ mi_argv_to_format (char **argv, int argc)
{
char tmp[5];
sprintf (tmp, "\\%o", (unsigned char) argv[0][i]);
xsnprintf (tmp, sizeof (tmp), "\\%o",
(unsigned char) argv[0][i]);
obstack_grow (&obstack, tmp, strlen (tmp));
}
break;