diff options
author | Mike Frysinger <vapier@gentoo.org> | 2012-04-01 04:15:30 +0000 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2012-04-01 04:15:30 +0000 |
commit | 7a8009d63457cb9ef21e3636b551f27fab3804e0 (patch) | |
tree | 649e108a020fc347862a588ceb423a80660daedd /opcodes/bfin-dis.c | |
parent | 768f88268faf58f5e54f0af2165c8fcb273ab60c (diff) | |
download | binutils-redhat-7a8009d63457cb9ef21e3636b551f27fab3804e0.tar.gz |
opcodes: bfin: simplify field width processing and fix build warnings
This fix the build time warning:
warning: format not a string literal, argument types not checked [-Wformat-nonliteral]
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Diffstat (limited to 'opcodes/bfin-dis.c')
-rw-r--r-- | opcodes/bfin-dis.c | 11 |
1 files changed, 1 insertions, 10 deletions
diff --git a/opcodes/bfin-dis.c b/opcodes/bfin-dis.c index 130dfc7719..7470ebdc2a 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) |