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 @@ -313,7 +313,8 @@ class simplecpp::TokenList::Stream {
313313
314314 // The UTF-16 BOM is 0xfffe or 0xfeff.
315315 if (ch1 >= 0xfe ) {
316- const unsigned short bom = (static_cast <unsigned char >(get ()) << 8 );
316+ (void )get ();
317+ const unsigned short bom = (static_cast <unsigned char >(ch1) << 8 );
317318 if (peek () >= 0xfe )
318319 return bom | static_cast <unsigned char >(get ());
319320 unget ();
@@ -323,12 +324,15 @@ class simplecpp::TokenList::Stream {
323324 // Skip UTF-8 BOM 0xefbbbf
324325 if (ch1 == 0xef ) {
325326 (void )get ();
326- if (get () == 0xbb && peek () == 0xbf ) {
327+ if (peek () == 0xbb ) {
327328 (void )get ();
328- } else {
329- unget ();
329+ if (peek () == 0xbf ) {
330+ (void )get ();
331+ return 0 ;
332+ }
330333 unget ();
331334 }
335+ unget ();
332336 }
333337
334338 return 0 ;
You can’t perform that action at this time.
0 commit comments