diff options
author | Thomas Martitz <kugel@rockbox.org> | 2012-01-22 21:22:53 +0100 |
---|---|---|
committer | Thomas Martitz <kugel@rockbox.org> | 2012-01-22 21:22:53 +0100 |
commit | 7dd65f7d9bf854f967116b6b2872a80a472dc7f5 (patch) | |
tree | 9cde180d895f4afc7964a4ec2c206925ad7999d6 /uisimulator/common | |
parent | 38050f46af0fba716b7538786e8b7adbb8401b7e (diff) | |
download | rockbox-7dd65f7d9bf854f967116b6b2872a80a472dc7f5.tar.gz rockbox-7dd65f7d9bf854f967116b6b2872a80a472dc7f5.tar.bz2 rockbox-7dd65f7d9bf854f967116b6b2872a80a472dc7f5.zip |
Another attempt at fixing storage_*_warnings. Correct return values also.
Change-Id: Ie04da59739f2ce31d5b777157b1214c921aa5615
Diffstat (limited to 'uisimulator/common')
-rw-r--r-- | uisimulator/common/stubs.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/uisimulator/common/stubs.c b/uisimulator/common/stubs.c index 6237caf949..a8ee5fb5ff 100644 --- a/uisimulator/common/stubs.c +++ b/uisimulator/common/stubs.c @@ -192,7 +192,7 @@ int storage_write_sectors(IF_MV2(int drive,) fclose(f); } } - return 1; + return 0; } int storage_read_sectors(IF_MV2(int drive,) @@ -202,6 +202,7 @@ int storage_read_sectors(IF_MV2(int drive,) { IF_MV((void)drive;) int i; + size_t ret; for (i=0; i<count; i++ ) { FILE* f; @@ -211,11 +212,13 @@ int storage_read_sectors(IF_MV2(int drive,) sprintf(name,"sector%lX.bin",start+i); f=fopen(name,"rb"); if (f) { - (void)fread(buf,512,1,f); + ret = fread(buf,512,1,f); fclose(f); + if (ret != 512) + return -1; } } - return 1; + return 0; } void storage_spin(void) |