Skip to content

Commit

Permalink
Testing: Fix for Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
shahramn committed Mar 6, 2024
1 parent 4b08450 commit 92cbaa0
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions tests/grib_update_sections_lengths.cc
Original file line number Diff line number Diff line change
Expand Up @@ -18,23 +18,24 @@ int main(int argc, char* argv[])
char* infile = 0;
char* oufile = 0;
int err = 0;
size_t size;
size_t size = 0;
const void* buffer = NULL;

if (argc < 3) return 1; // prog in out

infile = argv[1];
oufile = argv[2];

inf = fopen(infile, "r");
inf = fopen(infile, "rb");
Assert(inf);

ouf = fopen(oufile, "w");
ouf = fopen(oufile, "wb");
Assert(ouf);

while ((h = grib_handle_new_from_file(0, inf, &err)) != NULL) {
grib_update_sections_lengths(h);
GRIB_CHECK(grib_get_message(h, &buffer, &size), 0);
printf("size = %zu\n", size);
if (fwrite(buffer, 1, size, ouf) != size) {
perror(oufile);
exit(1);
Expand Down

0 comments on commit 92cbaa0

Please sign in to comment.