diff --git a/src/p_glnodes.cpp b/src/p_glnodes.cpp index 977426e57..bd574ad83 100644 --- a/src/p_glnodes.cpp +++ b/src/p_glnodes.cpp @@ -1137,7 +1137,8 @@ static void CreateCachedNodes(MapData *map) if (fw != nullptr) { - if (fw->Write(compressed, outlen+offset) != 1) + const size_t length = outlen + offset; + if (fw->Write(compressed, length) != length) { Printf("Error saving nodes to file %s\n", path.GetChars()); }