aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorAndrew Cagney <cagney@redhat.com>2002-01-12 20:00:07 +0000
committerAndrew Cagney <cagney@redhat.com>2002-01-12 20:00:07 +0000
commit17df2af65cc151cb9d073e85ab39a687e09e1c72 (patch)
tree118ca90ac404187bcbc691a2f654d0c6ef11217e /gdb
parent538a76d6b87c6633a7a8efaef9af41f83475a835 (diff)
downloadfsf-binutils-gdb-17df2af65cc151cb9d073e85ab39a687e09e1c72.zip
fsf-binutils-gdb-17df2af65cc151cb9d073e85ab39a687e09e1c72.tar.gz
fsf-binutils-gdb-17df2af65cc151cb9d073e85ab39a687e09e1c72.tar.bz2
Use phex_nz() not printf
Diffstat (limited to 'gdb')
-rw-r--r--gdb/ChangeLog6
-rw-r--r--gdb/language.c15
2 files changed, 8 insertions, 13 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 9379d19..fff8f0d 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,9 @@
+2002-01-12 Andrew Cagney <ac131313@redhat.com>
+
+ From Peter Schauer:
+ * language.c (longest_local_hex_string_custom): Use phex_nz to
+ convert NUM to a hex string.
+
2002-01-12 Elena Zannoni <ezannoni@redhat.com>
* sh-tdep.c (sh_gdbarch_init): Move setting of long_bit earlier in
diff --git a/gdb/language.c b/gdb/language.c
index 9c27f0d..f8525b6 100644
--- a/gdb/language.c
+++ b/gdb/language.c
@@ -662,21 +662,10 @@ longest_local_hex_string_custom (LONGEST num, char *width)
sprintf (res2, format, num);
return res2;
#else /* !defined (PRINTF_HAS_LONG_LONG) */
- /* Use strcat_address_numeric to print the number into a string, then
+ /* Use phex_nz to print the number into a string, then
build the result string from local_hex_format_prefix, padding and
the hex representation as indicated by "width". */
-
- temp_nbr_buf[0] = 0;
- /* With use_local == 0, we don't get the leading "0x" prefix. */
- /* MERGEBUG ?? As a quick fix I am replacing this call to
- strcat_address_numeric with sprintf
- strcat_address_numeric(num, 0, temp_nbr_buf, RESULT_BUF_LEN);
- */
-
- {
- long long ll = num;
- sprintf (temp_nbr_buf, "%llx", ll);
- }
+ strcpy (temp_nbr_buf, phex_nz (num, sizeof (num)));
/* parse width */
parse_ptr = width;
pad_on_left = 1;