diff options
-rw-r--r-- | opcodes/ChangeLog | 5 | ||||
-rw-r--r-- | opcodes/bfin-dis.c | 11 |
2 files changed, 6 insertions, 10 deletions
diff --git a/opcodes/ChangeLog b/opcodes/ChangeLog index a726499..0dec560 100644 --- a/opcodes/ChangeLog +++ b/opcodes/ChangeLog @@ -1,3 +1,8 @@ +2012-04-01 Mike Frysinger <vapier@gentoo.org> + + * bfin-dis.c (fmtconst): Replace decimal handling with a single + sprintf call and the '*' field width. + 2012-03-23 Maxim Kuvyrkov <maxim@codesourcery.com> * mips-dis.c (mips_arch_choices): Add entry for Broadcom XLP. diff --git a/opcodes/bfin-dis.c b/opcodes/bfin-dis.c index 130dfc7..7470ebd 100644 --- a/opcodes/bfin-dis.c +++ b/opcodes/bfin-dis.c @@ -162,16 +162,7 @@ fmtconst (const_forms_t cf, TIword x, bfd_vma pc, disassemble_info *outf) x <<= constant_formats[cf].scale; if (constant_formats[cf].decimal) - { - if (constant_formats[cf].leading) - { - char ps[10]; - sprintf (ps, "%%%ii", constant_formats[cf].leading); - sprintf (buf, ps, x); - } - else - sprintf (buf, "%li", x); - } + sprintf (buf, "%*li", constant_formats[cf].leading, x); else { if (constant_formats[cf].issigned && x < 0) |