diff options
author | Andrew Cagney <cagney@redhat.com> | 2001-11-15 18:35:05 +0000 |
---|---|---|
committer | Andrew Cagney <cagney@redhat.com> | 2001-11-15 18:35:05 +0000 |
commit | 45a1e866786da584cd7ca1752d1513ce8dbb85fc (patch) | |
tree | ed2fa557c2e2968775532a16bf651913da2085a5 /gdb/utils.c | |
parent | faf833caca7edee67628b5caf57e7091f443659e (diff) | |
download | gdb-45a1e866786da584cd7ca1752d1513ce8dbb85fc.zip gdb-45a1e866786da584cd7ca1752d1513ce8dbb85fc.tar.gz gdb-45a1e866786da584cd7ca1752d1513ce8dbb85fc.tar.bz2 |
Correctly handle phex(*,0) and phex_nz(*,0).
Diffstat (limited to 'gdb/utils.c')
-rw-r--r-- | gdb/utils.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/gdb/utils.c b/gdb/utils.c index 3775472..ed1b2b7 100644 --- a/gdb/utils.c +++ b/gdb/utils.c @@ -2418,22 +2418,25 @@ static int thirty_two = 32; char * phex (ULONGEST l, int sizeof_l) { - char *str = get_cell (); + char *str; switch (sizeof_l) { case 8: + str = get_cell (); sprintf (str, "%08lx%08lx", (unsigned long) (l >> thirty_two), (unsigned long) (l & 0xffffffff)); break; case 4: + str = get_cell (); sprintf (str, "%08lx", (unsigned long) l); break; case 2: + str = get_cell (); sprintf (str, "%04x", (unsigned short) (l & 0xffff)); break; default: - phex (l, sizeof (l)); + str = phex (l, sizeof (l)); break; } return str; |