Skip to content

Commit e6f1533

Browse files
committed
Issue #383 - Output message file text byte-by-byte
1 parent 98f32dd commit e6f1533

File tree

1 file changed

+15
-13
lines changed

1 file changed

+15
-13
lines changed

src/message.c

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -260,30 +260,32 @@ static void messagePos( TidyDocImpl* doc, TidyReportLevel level, uint code,
260260
if ( go )
261261
{
262262
enum { sizeBuf=1024 };
263-
char *buf = TidyDocAlloc(doc,sizeBuf);
263+
TidyOutputSink *outp = &doc->errout->sink;
264+
char *buf = (char *)TidyDocAlloc(doc,sizeBuf);
264265
const char *cp;
266+
byte b;
265267
if ( line > 0 && col > 0 )
266268
{
267269
ReportPosition(doc, line, col, buf, sizeBuf);
268-
#if !defined(NDEBUG) && defined(_MSC_VER)
269-
SPRTF("%s",buf);
270-
#endif
271270
for ( cp = buf; *cp; ++cp )
272-
TY_(WriteChar)( *cp, doc->errout );
271+
{
272+
b = (*cp & 0xff);
273+
outp->putByte( outp->sinkData, b );
274+
}
273275
}
274276

275277
LevelPrefix( level, buf, sizeBuf );
276-
#if !defined(NDEBUG) && defined(_MSC_VER)
277-
SPRTF("%s",buf);
278-
SPRTF("%s\n",messageBuf);
279-
#else
280278
for ( cp = buf; *cp; ++cp )
281-
TY_(WriteChar)( *cp, doc->errout );
282-
279+
{
280+
b = (*cp & 0xff);
281+
outp->putByte( outp->sinkData, b );
282+
}
283283
for ( cp = messageBuf; *cp; ++cp )
284-
TY_(WriteChar)( *cp, doc->errout );
284+
{
285+
b = (*cp & 0xff);
286+
outp->putByte( outp->sinkData, b );
287+
}
285288
TY_(WriteChar)( '\n', doc->errout );
286-
#endif
287289
TidyDocFree(doc, buf);
288290
}
289291
TidyDocFree(doc, messageBuf);

0 commit comments

Comments
 (0)