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); }