aboutsummaryrefslogtreecommitdiff
path: root/sim/bfin/bfin-sim.c
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2012-04-01 04:23:40 +0000
committerMike Frysinger <vapier@gentoo.org>2012-04-01 04:23:40 +0000
commit2fa7a0570bc9a5dc033457ce1769a90db0d3c990 (patch)
treece4e72dbed50f6bbedc002f5d03d26fcd4eb4d7e /sim/bfin/bfin-sim.c
parent02bb38cc809b286293a8227b86a64b09420754c0 (diff)
downloadfsf-binutils-gdb-2fa7a0570bc9a5dc033457ce1769a90db0d3c990.zip
fsf-binutils-gdb-2fa7a0570bc9a5dc033457ce1769a90db0d3c990.tar.gz
fsf-binutils-gdb-2fa7a0570bc9a5dc033457ce1769a90db0d3c990.tar.bz2
sim: 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 'sim/bfin/bfin-sim.c')
-rw-r--r--sim/bfin/bfin-sim.c11
1 files changed, 1 insertions, 10 deletions
diff --git a/sim/bfin/bfin-sim.c b/sim/bfin/bfin-sim.c
index 2c93e04..54d6bca 100644
--- a/sim/bfin/bfin-sim.c
+++ b/sim/bfin/bfin-sim.c
@@ -223,16 +223,7 @@ fmtconst_str (const_forms_t cf, bs32 x, bu32 pc)
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, "%i", x);
- }
+ sprintf (buf, "%*i", constant_formats[cf].leading, x);
else
{
if (constant_formats[cf].issigned && x < 0)