From faf833caca7edee67628b5caf57e7091f443659e Mon Sep 17 00:00:00 2001 From: Andrew Cagney Date: Thu, 15 Nov 2001 18:24:17 +0000 Subject: * utils.c (phex_nz): For default case, set str to phex_nz return value. --- gdb/ChangeLog | 5 +++++ gdb/utils.c | 7 +++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index ccb4363..4230841 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,10 @@ 2001-11-15 Andrew Cagney + * utils.c (phex_nz): For default case, set str to phex_nz return + value. + +2001-11-15 Andrew Cagney + * TODO (register_buffer): Delete. * regcache.c (register_buffer): Make static. (regcache_collect): New function. 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; -- cgit v1.1