mirror of
https://github.com/ChaiScript/ChaiScript.git
synced 2025-12-07 01:06:54 +08:00
Initialize buffer to store potential BOM data before storing
anything inside it.
This commit is contained in:
parent
edadb7aa98
commit
51bb793664
@ -208,7 +208,7 @@ namespace chaiscript
|
|||||||
static bool skip_bom(std::ifstream &infile) {
|
static bool skip_bom(std::ifstream &infile) {
|
||||||
std::streamsize bytes_needed = 3;
|
std::streamsize bytes_needed = 3;
|
||||||
std::streamsize bytes_read = 0;
|
std::streamsize bytes_read = 0;
|
||||||
char buffer[3];
|
char buffer[3] = { '\0' };
|
||||||
|
|
||||||
bytes_read = infile.readsome(buffer, bytes_needed);
|
bytes_read = infile.readsome(buffer, bytes_needed);
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user