fix btowc corner case
authorRich Felker <dalias@aerifal.cx>
Tue, 16 Jun 2015 04:21:38 +0000 (04:21 +0000)
committerRich Felker <dalias@aerifal.cx>
Tue, 16 Jun 2015 04:21:38 +0000 (04:21 +0000)
btowc is required to interpret its argument by conversion to unsigned
char, unless the argument is equal to EOF. since the conversion to
produces a non-character value anyway, we can just unconditionally
convert, for now.

src/multibyte/btowc.c

index 9d2c3b1..29cb798 100644 (file)
@@ -3,5 +3,6 @@
 
 wint_t btowc(int c)
 {
+       c = (unsigned char)c;
        return c<128U ? c : EOF;
 }