changeset 3524:aed9850ca011

oops, 8bit instead of 16
author michael
date Sun, 16 Dec 2001 13:24:13 +0000
parents dadab20dc2b4
children 03304fcb0090
files liba52/compare.c
diffstat 1 files changed, 11 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/liba52/compare.c	Sun Dec 16 11:51:02 2001 +0000
+++ b/liba52/compare.c	Sun Dec 16 13:24:13 2001 +0000
@@ -22,11 +22,16 @@
 	
 	for(;;)
 	{
-		int c0= fgetc(f0);
-		int c1= fgetc(f1);
-		int d= c0-c1;
-		if(c0<0 && c1<0) break;
-		if(c0<0 || c1<0)
+		short c0;
+		short c1;
+		int d;
+		
+		int e0= fread(&c0, 2, 1, f0);
+		int e1= fread(&c1, 2, 1, f1);
+		
+		d=c0-c1;
+		if(e0==0 && e1==0) break;
+		if(e0==0 || e1==0)
 		{
 			printf("FATAL error, files have different size!\n");
 			exit(1);
@@ -35,7 +40,7 @@
 		if(d<0) d=-d; // ABS
 		if(d>1)
 		{
-			printf("FATAL error, too large differnce found!\n");
+			printf("FATAL error, too large differnce found (%d)!\n", d);
 			exit(1);
 		}