Permalink
Browse files

Additional error handling in save manager. Don't display free space o…

…n flash drives since we can't get that from the RPC interface currently.
  • Loading branch information...
1 parent 302b737 commit b07cda8eda9b352b33762143969bcad5c4b4742c @root670 committed Sep 9, 2015
Showing with 10 additions and 5 deletions.
  1. +10 −5 saves.c
View
@@ -127,9 +127,12 @@ void savesDrawTicker()
freeSpace = 0;
}
- graphicsDrawTextCentered(47, deviceName, WHITE);
- snprintf(free, 20, "%d KB free", freeSpace);
- graphicsDrawText(30, 47, free, WHITE);
+ if(currentDevice != FLASH_DRIVE)
+ {
+ graphicsDrawTextCentered(47, deviceName, WHITE);
+ snprintf(free, 20, "%d KB free", freeSpace);
+ graphicsDrawText(30, 47, free, WHITE);
+ }
static int ticker_x = 0;
if (ticker_x < 1500)
@@ -986,11 +989,13 @@ static int doCopy(device_t src, device_t dst, gameSave_t *save)
if((src & (MC_SLOT_1|MC_SLOT_2)) && (dst == FLASH_DRIVE))
{
save->_handler = promptSaveHandler();
- save->_handler->create(save, src);
+ if(!save->_handler->create(save, src))
+ displayError("Error creating save file.");
}
else if((src == FLASH_DRIVE) && (dst & (MC_SLOT_1|MC_SLOT_2)))
{
- save->_handler->extract(save, dst);
+ if(!save->_handler->extract(save, dst))
+ displayError("Error extracting save file.");
}
return 1;

0 comments on commit b07cda8

Please sign in to comment.