X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=tests%2Fdata%2Fsack.c;h=0a1ada7fdaab03ed351768b7ae8e4f53e5e860ad;hb=339f1956cc727eda788638644ef93ab7852b31cd;hp=f27edacaa0ba856c22e50c63783d5bcff95e03cb;hpb=63c7521729b947ace9e192dff9330813ecfb5812;p=pspp diff --git a/tests/data/sack.c b/tests/data/sack.c index f27edacaa0..0a1ada7fda 100644 --- a/tests/data/sack.c +++ b/tests/data/sack.c @@ -38,6 +38,7 @@ #include "gl/intprops.h" #include "gl/progname.h" #include "gl/xalloc.h" +#include "gl/xbinary-io.h" struct buffer { @@ -596,7 +597,7 @@ parse_data_item (struct buffer *output) if (sym->offset == UINT_MAX) sym->offset = output->size; else if (sym->offset != output->size) - fatal ("%s: can't redefine label for offset %u with offset %u", + fatal ("%s: can't redefine label for offset %u with offset %zu", tok_string, sym->offset, output->size); get_token (); return; @@ -704,7 +705,9 @@ main (int argc, char **argv) if (input != stdin) fclose (input); + xset_binary_mode (fileno (stdout), O_BINARY); fwrite (output.data, output.size, 1, stdout); + free (output.data); return 0; }