Adapted to new library format.

git-svn-id: svn://svn.cc65.org/cc65/trunk@4946 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
uz
2011-01-28 16:03:55 +00:00
parent fa1b5f5f3c
commit 8af53cf22a
2 changed files with 42 additions and 27 deletions

View File

@@ -198,7 +198,8 @@ unsigned Read8 (FILE* F)
{
int C = getc (F);
if (C == EOF) {
Error ("Read error (file corrupt?)");
long Pos = ftell (F);
Error ("Read error at position %ld (file corrupt?)", Pos);
}
return C;
}
@@ -325,7 +326,8 @@ void* ReadData (FILE* F, void* Data, unsigned Size)
/* Explicitly allow reading zero bytes */
if (Size > 0) {
if (fread (Data, 1, Size, F) != Size) {
Error ("Read error (file corrupt?)");
long Pos = ftell (F);
Error ("Read error at position %ld (file corrupt?)", Pos);
}
}
return Data;