Gunnar Evermann <ge204(a)eng.cam.ac.uk> writes:
for example, what about this code in fileio.c:
error ("IO error reading %s: %s",
XSTRING_DATA (filename), strerror (saverrno));
now surely *this* is wrong or am I missing something again?
Obviously noone thought about strerror() returning non-ASCII stuff.
The correct way to write the above would be something like:
Bufbyte *internal_strerror;
TO_INTERNAL_FORMAT (C_STRING, strerror (saverrno),
C_STRING_ALLOCA, internal_strerror,
Qnative);
error ("IO error reading %s: %s",
XSTRING_DATA (filename), internal_strerror);
Even better, the code should be modified to use report_file_error() or
one of its relatives (if possible.)