diff dstress.c @ 292:7e28d437d6d7

fixed Windows loadFile return code bug
author thomask
date Sat, 19 Feb 2005 11:15:48 +0000
parents 68b883fe4fad
children a74c84e75682
line wrap: on
line diff
--- a/dstress.c	Sat Feb 19 11:15:17 2005 +0000
+++ b/dstress.c	Sat Feb 19 11:15:48 2005 +0000
@@ -127,13 +127,15 @@
 		size = GetFileSize(file, NULL);
 		if (size != INVALID_FILE_SIZE){
 			back=malloc((size+1)*sizeof(char));
-			if (ReadFile(file,back,size,&numread,NULL) == 0){
-				if (numread==size)
+			if (ReadFile(file,back,size,&numread,NULL) == 1){
+				if (numread==size){
 					*(back+size+1) = '\x00';
-				else
+				}else{
 					back = "\x00";
-			}else
+				}
+			}else{
 				back = "\x00";
+			}
 		}
 		CloseHandle(file);
 	}