Adjust Header to be non Nul Terminated
This commit is contained in:
@@ -88,9 +88,8 @@ namespace file
|
||||
{
|
||||
std::ifstream in(BASE_DIRECTORY SIMDATABASE, std::ifstream::binary);
|
||||
|
||||
// File Header
|
||||
std::string ident = readString(in, 5);
|
||||
if (ident.compare("VGAS") != 0) {
|
||||
if (ident.compare(SIMDATABASE_HEADER) != 0) {
|
||||
throw std::invalid_argument("Wrong file");
|
||||
}
|
||||
std::uint8_t version = read<std::uint8_t>(in);
|
||||
@@ -133,9 +132,9 @@ namespace file
|
||||
{
|
||||
std::ofstream out(BASE_DIRECTORY SIMDATABASE, std::fstream::binary);
|
||||
|
||||
// File Header, Last member is version
|
||||
std::uint8_t header[] = {'V', 'G', 'A', 'S', '\0', 1};
|
||||
out.write(reinterpret_cast<const char *>(header), 6);
|
||||
// File Header
|
||||
out.write(SIMDATABASE_HEADER, 4);
|
||||
out.write("\1", 1);
|
||||
// Num Airports
|
||||
write<std::uint16_t>(out, airports.size());
|
||||
// Airport
|
||||
|
||||
Reference in New Issue
Block a user