[v3,4/4] Fix a FIXME in mi-out.c

Message ID 20190709152436.14078-5-tromey@adacore.com
State New
Headers show
Series
  • Remove many uses of field_fmt
Related show

Commit Message

Tom Tromey July 9, 2019, 3:24 p.m.
This removes a FIXME comment from mi_ui_out::do_field_int, by
replacing a printf with a use of plongest.

gdb/ChangeLog
2019-07-09  Tom Tromey  <tromey@adacore.com>

	* mi/mi-out.c (mi_ui_out::do_field_int): Use plongest.
---
 gdb/ChangeLog   | 4 ++++
 gdb/mi/mi-out.c | 5 +----
 2 files changed, 5 insertions(+), 4 deletions(-)

-- 
2.20.1

Patch

diff --git a/gdb/mi/mi-out.c b/gdb/mi/mi-out.c
index dd99a2b7fb1..75e3f0313d8 100644
--- a/gdb/mi/mi-out.c
+++ b/gdb/mi/mi-out.c
@@ -98,10 +98,7 @@  void
 mi_ui_out::do_field_int (int fldno, int width, ui_align alignment,
 			 const char *fldname, int value)
 {
-  char buffer[20];	/* FIXME: how many chars long a %d can become? */
-
-  xsnprintf (buffer, sizeof (buffer), "%d", value);
-  do_field_string (fldno, width, alignment, fldname, buffer,
+  do_field_string (fldno, width, alignment, fldname, plongest (value),
 		   ui_out_style_kind::DEFAULT);
 }