(v_message_with_decl): Avoid fwrite for stderr; mixing it with fprintf

and fputs can cause strange results under VMS.

From-SVN: r7570
This commit is contained in:
Richard Kenner 1994-06-26 05:37:16 -04:00
parent 13018fad5e
commit cb039f8aa0

View File

@ -1149,10 +1149,17 @@ v_message_with_decl (decl, prefix, s, ap)
}
}
if (p > s)
fwrite (s, p - s, 1, stderr);
if (p > s) /* Print the left-hand substring. */
{
char fmt[sizeof "%.255s"];
long width = p - s;
if (width > 255L) width = 255L; /* arbitrary */
sprintf (fmt, "%%.%lds", width);
fprintf (stderr, fmt, s);
}
if (*p == '%')
if (*p == '%') /* Print the name. */
{
char *n = (DECL_NAME (decl)
? (*decl_printable_name) (decl, &junk)
@ -1166,7 +1173,7 @@ v_message_with_decl (decl, prefix, s, ap)
}
}
if (*p)
if (*p) /* Print the rest of the message. */
vmessage ((char *)NULL, p, ap);
fputc ('\n', stderr);