mirror of
https://github.com/mangosfour/server.git
synced 2025-12-21 01:37:05 +00:00
[6875] Skip utf8 header (if exist) for mangosd.conf file
This commit is contained in:
parent
d3b4b341a0
commit
2907868b80
2 changed files with 6 additions and 1 deletions
|
|
@ -340,6 +340,11 @@ int DOTCONFDocument::setContent(const char * _fileName)
|
|||
error(0, NULL, "failed to open file '%s': %s", fileName, strerror(errno));
|
||||
return -1;
|
||||
}
|
||||
// Try read utf8 header and skip it if exist
|
||||
uint32 utf8header = 0;
|
||||
fgets((char*)&utf8header, 4, file); // Try read header
|
||||
if (utf8header!=0x00BFBBEF) // If not exist
|
||||
fseek(file, 0, SEEK_SET); // Reset read position
|
||||
|
||||
ret = parseFile();
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue