aboutsummaryrefslogtreecommitdiff
path: root/binutils
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2002-05-27 08:40:35 +0000
committerAlan Modra <amodra@gmail.com>2002-05-27 08:40:35 +0000
commit3eee1e9d04a0b9337ac03282c8483531cd21d536 (patch)
tree09a4a231302d600956118adf922be22de95c0b7e /binutils
parentee3cc2e2eef036f2175d91ccba93d523d5418e23 (diff)
downloadgdb-3eee1e9d04a0b9337ac03282c8483531cd21d536.zip
gdb-3eee1e9d04a0b9337ac03282c8483531cd21d536.tar.gz
gdb-3eee1e9d04a0b9337ac03282c8483531cd21d536.tar.bz2
* unwind-ia64.c (unw_print_brmask): Don't use sprintf.
(unw_print_grmask): Likewise. (unw_print_frmask): Likewise.
Diffstat (limited to 'binutils')
-rw-r--r--binutils/ChangeLog6
-rw-r--r--binutils/unwind-ia64.c37
2 files changed, 32 insertions, 11 deletions
diff --git a/binutils/ChangeLog b/binutils/ChangeLog
index 01282d8..330d707 100644
--- a/binutils/ChangeLog
+++ b/binutils/ChangeLog
@@ -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.
diff --git a/binutils/unwind-ia64.c b/binutils/unwind-ia64.c
index 5dcd2a7..803a5fa 100644
--- a/binutils/unwind-ia64.c
+++ b/binutils/unwind-ia64.c
@@ -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