mirror of
https://github.com/joel16/VitaShell.git
synced 2024-11-23 11:49:40 +00:00
Added error handling in copy/extract file.
This commit is contained in:
parent
4ba8f5ee52
commit
163f34db05
12
archive.c
12
archive.c
@ -210,7 +210,17 @@ int extractArchivePath(char *src, char *dst, uint32_t *value, uint32_t max, void
|
||||
|
||||
int read;
|
||||
while ((read = archiveFileRead(fdsrc, buf, TRANSFER_SIZE)) > 0) {
|
||||
sceIoWrite(fddst, buf, read);
|
||||
int res = sceIoWrite(fddst, buf, read);
|
||||
if (res < 0) {
|
||||
free(buf);
|
||||
|
||||
sceIoClose(fddst);
|
||||
archiveFileClose(fdsrc);
|
||||
|
||||
fileListEmpty(&list);
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
if (value)
|
||||
(*value) += read;
|
||||
|
10
file.c
10
file.c
@ -241,7 +241,15 @@ int copyFile(char *src_path, char *dst_path, uint32_t *value, uint32_t max, void
|
||||
|
||||
int read;
|
||||
while ((read = sceIoRead(fdsrc, buf, TRANSFER_SIZE)) > 0) {
|
||||
sceIoWrite(fddst, buf, read);
|
||||
int res = sceIoWrite(fddst, buf, read);
|
||||
if (res < 0) {
|
||||
free(buf);
|
||||
|
||||
sceIoClose(fddst);
|
||||
sceIoClose(fdsrc);
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
if (value)
|
||||
(*value) += read;
|
||||
|
Loading…
Reference in New Issue
Block a user