File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed
Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -311,7 +311,8 @@ class simplecpp::TokenList::Stream {
311311
312312 // The UTF-16 BOM is 0xfffe or 0xfeff.
313313 if (ch1 >= 0xfe ) {
314- const unsigned short bom = (static_cast <unsigned char >(get ()) << 8 );
314+ (void )get ();
315+ const unsigned short bom = (static_cast <unsigned char >(ch1) << 8 );
315316 if (peek () >= 0xfe )
316317 return bom | static_cast <unsigned char >(get ());
317318 unget ();
@@ -321,12 +322,15 @@ class simplecpp::TokenList::Stream {
321322 // Skip UTF-8 BOM 0xefbbbf
322323 if (ch1 == 0xef ) {
323324 (void )get ();
324- if (get () == 0xbb && peek () == 0xbf ) {
325+ if (peek () == 0xbb ) {
325326 (void )get ();
326- } else {
327- unget ();
327+ if (peek () == 0xbf ) {
328+ (void )get ();
329+ return 0 ;
330+ }
328331 unget ();
329332 }
333+ unget ();
330334 }
331335
332336 return 0 ;
You can’t perform that action at this time.
0 commit comments