From 07e7179c74ed281c7fc48d2b2f1dd23aa1ba049e Mon Sep 17 00:00:00 2001 From: Eric Wasylishen Date: Sat, 15 Jan 2022 18:51:33 -0700 Subject: [PATCH] fix build --- bsputil/decompile.cpp | 3 ++- light/entities.cc | 2 +- qbsp/test_qbsp.cc | 4 +++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/bsputil/decompile.cpp b/bsputil/decompile.cpp index 8313f6bb..ebad86b9 100644 --- a/bsputil/decompile.cpp +++ b/bsputil/decompile.cpp @@ -1032,7 +1032,8 @@ static void DecompileEntity( } else if (areaportal_brush && keyValue.first == "style") { continue; } else if (modelNum > 0 && keyValue.first == "origin") { - parser_t parser(keyValue.second.data()); + auto &value = keyValue.second; + parser_t parser(value.data(), value.data() + value.size()); qvec3d vec; parser.parse_token(); vec[0] = stof(parser.token); diff --git a/light/entities.cc b/light/entities.cc index 6c7fb413..d8c4a946 100644 --- a/light/entities.cc +++ b/light/entities.cc @@ -1404,7 +1404,7 @@ bool ParseLightsFile(const std::filesystem::path &fname) while (!f.eof()) { std::getline(f, buf); - parser_t parser(buf.c_str()); + parser_t parser(buf.data(), buf.data() + buf.size()); if (!parser.parse_token()) continue; diff --git a/qbsp/test_qbsp.cc b/qbsp/test_qbsp.cc index 89d88f82..ddc752e1 100644 --- a/qbsp/test_qbsp.cc +++ b/qbsp/test_qbsp.cc @@ -3,6 +3,8 @@ #include #include +#include + // FIXME: Clear global data (planes, etc) between each test static face_t *Brush_FirstFaceWithTextureName(brush_t *brush, const char *texname) @@ -30,7 +32,7 @@ static mapentity_t LoadMap(const char *map) options.target_version = &bspver_q1; options.target_game = options.target_version->game; - parser_t parser(map); + parser_t parser(map, map + strlen(map)); mapentity_t worldspawn; // FIXME: adds the brush to the global map...