From: Andrew Cagney Date: Thu, 15 Nov 2001 18:24:17 +0000 (+0000) Subject: * utils.c (phex_nz): For default case, set str to phex_nz return X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=faf833caca7edee67628b5caf57e7091f443659e;p=binutils-gdb.git * utils.c (phex_nz): For default case, set str to phex_nz return value. --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index ccb436302c8..423084169e0 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +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. diff --git a/gdb/utils.c b/gdb/utils.c index e27380ab2de..377547280b6 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;