notaz.gp2x.de
/
pcsx_rearmed.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge pull request #642 from StormedBubbles/guncon
[pcsx_rearmed.git]
/
libpcsxcore
/
sio.c
diff --git
a/libpcsxcore/sio.c
b/libpcsxcore/sio.c
index
4e26907
..
8392fd8
100644
(file)
--- a/
libpcsxcore/sio.c
+++ b/
libpcsxcore/sio.c
@@
-454,7
+454,12
@@
void LoadMcd(int mcd, char *str) {
else if(buf.st_size == MCD_SIZE + 3904)
fseek(f, 3904, SEEK_SET);
}
else if(buf.st_size == MCD_SIZE + 3904)
fseek(f, 3904, SEEK_SET);
}
- fread(data, 1, MCD_SIZE, f);
+ if (fread(data, 1, MCD_SIZE, f) != MCD_SIZE) {
+#ifndef NDEBUG
+ SysPrintf(_("File IO error in <%s:%s>.\n"), __FILE__, __func__);
+#endif
+ memset(data, 0x00, MCD_SIZE);
+ }
fclose(f);
}
else
fclose(f);
}
else
@@
-469,7
+474,12
@@
void LoadMcd(int mcd, char *str) {
else if(buf.st_size == MCD_SIZE + 3904)
fseek(f, 3904, SEEK_SET);
}
else if(buf.st_size == MCD_SIZE + 3904)
fseek(f, 3904, SEEK_SET);
}
- fread(data, 1, MCD_SIZE, f);
+ if (fread(data, 1, MCD_SIZE, f) != MCD_SIZE) {
+#ifndef NDEBUG
+ SysPrintf(_("File IO error in <%s:%s>.\n"), __FILE__, __func__);
+#endif
+ memset(data, 0x00, MCD_SIZE);
+ }
fclose(f);
}
}
fclose(f);
}
}