mirror of
https://github.com/ChaiScript/ChaiScript.git
synced 2025-12-08 01:36:54 +08:00
Check EOF rather than buffer_size when skipping BOM.
This commit is contained in:
parent
67dcd3e8d8
commit
4ada12a34c
@ -212,7 +212,7 @@ namespace chaiscript
|
||||
infile.read(&v[0], static_cast<std::streamsize>(bytes_needed));
|
||||
std::string buffer_string(v.begin(), v.end());
|
||||
|
||||
if ((buffer_string.size() > 2)
|
||||
if (!infile.eof()
|
||||
&& (buffer_string[0] == '\xef')
|
||||
&& (buffer_string[1] == '\xbb')
|
||||
&& (buffer_string[2] == '\xbf')) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user