epic fail on my part. integer overflow. the s_bfree and such are all long values

This commit is contained in:
Koushik K. Dutta 2010-03-25 19:04:08 -07:00
parent fe84a7ff84
commit 04159f738f
2 changed files with 3 additions and 3 deletions

View File

@ -26,7 +26,7 @@ LOCAL_MODULE := recovery
LOCAL_FORCE_STATIC_EXECUTABLE := true
RECOVERY_VERSION := ClockworkMod Recovery v1.7.8.0
RECOVERY_VERSION := ClockworkMod Recovery v1.7.8.1
LOCAL_CFLAGS := -DRECOVERY_VERSION="$(RECOVERY_VERSION)"
RECOVERY_API_VERSION := 2
LOCAL_CFLAGS += -DRECOVERY_API_VERSION=$(RECOVERY_API_VERSION)

View File

@ -108,8 +108,8 @@ int nandroid_backup(char* backup_path)
struct statfs s;
if (0 != (ret = statfs("/sdcard", &s)))
return print_and_error("Unable to stat /sdcard\n");
int sdcard_free = s.f_bfree * s.f_bsize;
if (sdcard_free < 150000000)
long sdcard_free = s.f_bfree * s.f_bsize;
if (sdcard_free < 150000000L)
return print_and_error("There is not enough free space on the SD Card! At least 150MB is required to create a backup.\n");
char tmp[PATH_MAX];