diff lwar/extract.c @ 265:6f4c4d59666f

Make lwar use the "b" flag when opening files. Due to the dumbness on Windows systems related to text vs. binary file distinctions, one needs to add 'b' to fopen() calls when dealing with binary files.
author William Astle <lost@l-w.ca>
date Sun, 10 Feb 2013 19:22:24 -0700
parents 346966cffeef
children 45df37e81741
line wrap: on
line diff
--- a/lwar/extract.c	Wed Feb 06 21:43:10 2013 -0700
+++ b/lwar/extract.c	Sun Feb 10 19:22:24 2013 -0700
@@ -36,7 +36,7 @@
 	int i;
 	FILE *nf;
 	
-	f = fopen(archive_file, "r");
+	f = fopen(archive_file, "rb");
 	if (!f)
 	{
 		perror("Opening archive file");
@@ -98,7 +98,7 @@
 		if (i < nfiles || nfiles == 0)
 		{
 			// extract the file
-			nf = fopen(fnbuf, "w");
+			nf = fopen(fnbuf, "wb");
 			if (!nf)
 			{
 				fprintf(stderr, "Cannot extract '%s': %s\n", fnbuf, strerror(errno));