From 6afbb917317fbf2a3a5d8b42db321721a5d5ead3 Mon Sep 17 00:00:00 2001 From: Jiyoung Yun Date: Tue, 28 Jul 2015 16:03:59 +0900 Subject: [PATCH] libstorage: Fixed wrong space value The size of unsigned long long is not the same with int's size. But it has copied int value to unsigned long long value. It makes wrong copy operation. Change-Id: Ief253146585ffc7474f9bd623c4680c8d516ede5 Signed-off-by: Jiyoung Yun --- src/storage-sdcard.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/storage-sdcard.c b/src/storage-sdcard.c index fc02c6b..70be220 100755 --- a/src/storage-sdcard.c +++ b/src/storage-sdcard.c @@ -61,13 +61,11 @@ static int sdcard_get_space(unsigned long long *total, unsigned long long *avail { storage_state_e state; struct statvfs s; - int ret, t, a; + int ret; + unsigned long long t = 0, a = 0; state = sdcard_get_state(); - if (state < STORAGE_STATE_MOUNTED) { - t = 0; - a = 0; - } else { /* if sdcard is mounted */ + if (state >= STORAGE_STATE_MOUNTED) { #ifndef __USE_FILE_OFFSET64 ret = storage_get_external_memory_size(&s); #else -- 2.7.4