|
From: Tim R. <row...@us...> - 2002-04-05 00:42:32
|
Update of /cvsroot/squeak/squeak/platforms/RiscOS/vm
In directory usw-pr-cvs1:/tmp/cvs-serv9999/platforms/RiscOS/vm
Modified Files:
sqArgument.c
Log Message:
Add fix for checking for image files - fseek 512 if initial peek fails to allowfor unix added pre-header
Index: sqArgument.c
===================================================================
RCS file: /cvsroot/squeak/squeak/platforms/RiscOS/vm/sqArgument.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** sqArgument.c 29 Jan 2002 04:54:09 -0000 1.2
--- sqArgument.c 5 Apr 2002 00:42:25 -0000 1.3
***************
*** 40,51 ****
/* no luck at beginning of file, seek to 512 and try again */
if(fseek( fp, 512, SEEK_SET)) {
! /* seek failed, which implies fileis too small */
fclose(fp);
return false;
}
! if(fread(&magic, 1, sizeof(magic), fp) != sizeof(magic)) {
! /* could not read an int from file */
! fclose(fp);
! return 0;
}
if (magic > 0xFFFF) {
--- 40,51 ----
/* no luck at beginning of file, seek to 512 and try again */
if(fseek( fp, 512, SEEK_SET)) {
! /* seek failed, which implies file is too small */
fclose(fp);
return false;
}
! if(fread(&magic, 1, sizeof(magic), fp) != sizeof(magic)) {
! /* could not read an int from file */
! fclose(fp);
! return 0;
}
if (magic > 0xFFFF) {
***************
*** 57,60 ****
--- 57,61 ----
return true;
}
+ fclose(fp);
return false;
}
|