aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorKaveh R. Ghazi <ghazi@caip.rutgers.edu>1999-12-27 16:52:03 +0000
committerKaveh Ghazi <ghazi@gcc.gnu.org>1999-12-27 16:52:03 +0000
commitcfa9f252201a4c30d101b098bd0f3e1d315f5d35 (patch)
tree3f7c0194301a32d799356810134caa7c38f99e30 /gcc
parent759af044d472040bebcfbde1ed735d24321a0ff0 (diff)
downloadgcc-cfa9f252201a4c30d101b098bd0f3e1d315f5d35.zip
gcc-cfa9f252201a4c30d101b098bd0f3e1d315f5d35.tar.gz
gcc-cfa9f252201a4c30d101b098bd0f3e1d315f5d35.tar.bz2
diagnostic.c (v_message_with_decl): Use .* format specifier instead of building the format specifier width manually.
* diagnostic.c (v_message_with_decl): Use .* format specifier instead of building the format specifier width manually. From-SVN: r31101
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog3
-rw-r--r--gcc/diagnostic.c9
2 files changed, 4 insertions, 8 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 35ee30d..676a525 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,8 @@
1999-12-27 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+ * diagnostic.c (v_message_with_decl): Use .* format specifier
+ instead of building the format specifier width manually.
+
* system.h (strsignal): Don't check HAVE_STRSIGNAL when
determining whether to provide a prototype. Remove the
sys_siglist clause in the conditional.
diff --git a/gcc/diagnostic.c b/gcc/diagnostic.c
index 8572913..1365e71 100644
--- a/gcc/diagnostic.c
+++ b/gcc/diagnostic.c
@@ -198,14 +198,7 @@ v_message_with_decl (decl, warn, msgid, ap)
}
if (p > _(msgid)) /* Print the left-hand substring. */
- {
- char fmt[sizeof "%.255s"];
- long width = p - _(msgid);
-
- if (width > 255L) width = 255L; /* arbitrary */
- sprintf (fmt, "%%.%lds", width);
- fprintf (stderr, fmt, _(msgid));
- }
+ fprintf (stderr, "%.*s", (int)(p - _(msgid)), _(msgid));
if (*p == '%') /* Print the name. */
{