Просмотр исходного кода

fix btowc corner case

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.
Rich Felker 9 лет назад
Родитель
Сommit
38e2f72723
1 измененных файлов с 1 добавлено и 0 удалено
  1. 1 0
      src/multibyte/btowc.c

+ 1 - 0
src/multibyte/btowc.c

@@ -3,5 +3,6 @@
 
 wint_t btowc(int c)
 {
+	c = (unsigned char)c;
 	return c<128U ? c : EOF;
 }