* utils.c (phex_nz): For default case, set str to phex_nz return

value.
This commit is contained in:
Andrew Cagney 2001-11-15 18:24:17 +00:00
parent a847613f74
commit faf833caca
2 changed files with 10 additions and 2 deletions

View File

@ -1,3 +1,8 @@
2001-11-15 Andrew Cagney <ac131313@redhat.com>
* utils.c (phex_nz): For default case, set str to phex_nz return
value.
2001-11-15 Andrew Cagney <ac131313@redhat.com>
* TODO (register_buffer): Delete.

View File

@ -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;