We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ae1f0fb commit 14a44ebCopy full SHA for 14a44eb
simplecpp.cpp
@@ -282,9 +282,10 @@ class simplecpp::TokenList::Stream {
282
// character is non-ASCII character then replace it with 0xff
283
if (isUtf16) {
284
(void)get();
285
- const auto ch2 = static_cast<unsigned char>(peek());
286
- unget();
287
- const int ch16 = makeUtf16Char(ch, ch2);
+ const int ch2 = peek();
+ if (ch2 != EOF)
+ unget();
288
+ const int ch16 = makeUtf16Char(ch, static_cast<unsigned char>(ch2));
289
ch = static_cast<unsigned char>(((ch16 >= 0x80) ? 0xff : ch16));
290
}
291
0 commit comments