From 6a6ec0c038db1583a02efad02ba902bf113a0557 Mon Sep 17 00:00:00 2001 From: Erica Fischer Date: Wed, 26 Jun 2024 11:42:13 -0700 Subject: [PATCH] Oops, checking for the wrong expected return value --- main.cpp | 2 +- tile.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/main.cpp b/main.cpp index 183ec102..c90e892a 100644 --- a/main.cpp +++ b/main.cpp @@ -2232,7 +2232,7 @@ std::pair read_input(std::vector &sources, char *fname, i estimated_complexity = geompos; fflush(geomfile); - if (pwrite(fileno(geomfile), &estimated_complexity, sizeof(estimated_complexity), 0) != 0) { + if (pwrite(fileno(geomfile), &estimated_complexity, sizeof(estimated_complexity), 0) != sizeof(estimated_complexity)) { perror("pwrite estimated complexity"); exit(EXIT_WRITE); } diff --git a/tile.cpp b/tile.cpp index 7e9eb5d0..9c0c9e58 100644 --- a/tile.cpp +++ b/tile.cpp @@ -2094,7 +2094,7 @@ long long write_tile(decompressor *geoms, std::atomic *geompos_in, ch if (additional[A_TRUNCATE_ZOOMS]) { fflush(geomfile[j]->fp); - if (pwrite(fileno(geomfile[j]->fp), &estimated_complexity_out, sizeof(estimated_complexity_out), start_geompos[j]) != 0) { + if (pwrite(fileno(geomfile[j]->fp), &estimated_complexity_out, sizeof(estimated_complexity_out), start_geompos[j]) != sizeof(estimated_complexity_out)) { perror("pwrite complexity"); exit(EXIT_WRITE); }