From: Jiyoung Yun Date: Tue, 28 Jul 2015 07:03:59 +0000 (+0900) Subject: libstorage: Fixed wrong space value X-Git-Tag: accepted/tizen/mobile/20150729.011140^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F16%2F44816%2F2;p=platform%2Fcore%2Fsystem%2Flibstorage.git 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 --- 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