aboutsummaryrefslogtreecommitdiff
path: root/gdb/utils.c
diff options
context:
space:
mode:
authorAndrew Cagney <cagney@redhat.com>2001-11-15 18:24:17 +0000
committerAndrew Cagney <cagney@redhat.com>2001-11-15 18:24:17 +0000
commitfaf833caca7edee67628b5caf57e7091f443659e (patch)
treeac1fd33f97d51fd1299593951c8afa233701449f /gdb/utils.c
parenta847613f7489967c9bf31c82fab3fb44e5d9d7e2 (diff)
downloadgdb-faf833caca7edee67628b5caf57e7091f443659e.zip
gdb-faf833caca7edee67628b5caf57e7091f443659e.tar.gz
gdb-faf833caca7edee67628b5caf57e7091f443659e.tar.bz2
* utils.c (phex_nz): For default case, set str to phex_nz return
value.
Diffstat (limited to 'gdb/utils.c')
-rw-r--r--gdb/utils.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/gdb/utils.c b/gdb/utils.c
index e27380a..3775472 100644
--- a/gdb/utils.c
+++ b/gdb/utils.c
@@ -2442,12 +2442,13 @@ phex (ULONGEST l, int sizeof_l)
char *
phex_nz (ULONGEST l, int sizeof_l)
{
- char *str = get_cell ();
+ char *str;
switch (sizeof_l)
{
case 8:
{
unsigned long high = (unsigned long) (l >> thirty_two);
+ str = get_cell ();
if (high == 0)
sprintf (str, "%lx", (unsigned long) (l & 0xffffffff));
else
@@ -2456,13 +2457,15 @@ phex_nz (ULONGEST l, int sizeof_l)
break;
}
case 4:
+ str = get_cell ();
sprintf (str, "%lx", (unsigned long) l);
break;
case 2:
+ str = get_cell ();
sprintf (str, "%x", (unsigned short) (l & 0xffff));
break;
default:
- phex_nz (l, sizeof (l));
+ str = phex_nz (l, sizeof (l));
break;
}
return str;