* unwind-ia64.c (unw_print_brmask): Don't use sprintf.

(unw_print_grmask): Likewise.
	(unw_print_frmask): Likewise.
This commit is contained in:
Alan Modra 2002-05-27 08:40:35 +00:00
parent ee3cc2e2ee
commit 3eee1e9d04
2 changed files with 32 additions and 11 deletions

View file

@ -1,3 +1,9 @@
2002-05-27 Alan Modra <amodra@bigpond.net.au>
* unwind-ia64.c (unw_print_brmask): Don't use sprintf.
(unw_print_grmask): Likewise.
(unw_print_frmask): Likewise.
2002-05-26 Kazu Hirata <kazu@cs.umass.edu>
* arsup.c: Remove ARGSUSED.

View file

@ -44,15 +44,18 @@ unw_print_brmask (cp, mask)
char * cp;
unsigned int mask;
{
char *sep = "";
int sep = 0;
int i;
for (i = 0; mask && (i < 5); ++i)
{
if (mask & 1)
{
cp += sprintf (cp, "%sb%u", sep, i + 1);
sep = ",";
if (sep)
*cp++ = ',';
*cp++ = 'b';
*cp++ = i + 1 + '0';
sep = 1;
}
mask >>= 1;
}
@ -64,19 +67,22 @@ unw_print_grmask (cp, mask)
char * cp;
unsigned int mask;
{
char *sep = "";
int sep = 0;
int i;
*cp = '\0';
for (i = 0; i < 4; ++i)
{
if (mask & 1)
{
cp += sprintf (cp, "%sr%u", sep, i + 4);
sep = ",";
if (sep)
*cp++ = ',';
*cp++ = 'r';
*cp++ = i + 4 + '0';
sep = 1;
}
mask >>= 1;
}
*cp = '\0';
}
static void
@ -84,19 +90,28 @@ unw_print_frmask (cp, mask)
char * cp;
unsigned int mask;
{
char *sep = "";
int sep = 0;
int i;
*cp = '\0';
for (i = 0; i < 20; ++i)
{
if (mask & 1)
{
cp += sprintf (cp, "%sf%u", sep, (i < 4) ? (i + 2) : (i + 12));
sep = ",";
if (sep)
*cp++ = ',';
*cp++ = 'f';
if (i < 4)
*cp++ = i + 2 + '0';
else
{
*cp++ = (i + 2) / 10 + 1 + '0';
*cp++ = (i + 2) % 10 + '0';
}
sep = 1;
}
mask >>= 1;
}
*cp = '\0';
}
static void