From 50b4c3fd551099f5975c55f0cf2ed8349e02fb39 Mon Sep 17 00:00:00 2001 From: Johan Hedberg Date: Mon, 14 Sep 2009 13:29:46 +0300 Subject: [PATCH] obexd: Fix free space calculation on systems where fsfilcnt_t is 32-bit On some platforms f_bavail will be a 32-bit variable and in that case we need to make sure that the multiplication of it with f_bsize is done in 64-bits. Therefore, explicitly typecast f_bsize to 64-bit before the multiplication. --- obexd/src/obex.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/obexd/src/obex.c b/obexd/src/obex.c index 53ec9b92c..9ec9c5b66 100644 --- a/obexd/src/obex.c +++ b/obexd/src/obex.c @@ -751,7 +751,7 @@ static gboolean check_put(obex_t *obex, obex_object_t *obj) return FALSE; } - free = buf.f_bsize * buf.f_bavail; + free = (unsigned long long) buf.f_bsize * buf.f_bavail; debug("Free space in disk: %llu", free); if ((guint64) os->size > free) { debug("Free disk space not available"); -- 2.47.3