smsutil: Make sure to return 1/0
authorDenis Kenzior <denkenz@gmail.com>
Wed, 4 Sep 2013 03:58:59 +0000 (22:58 -0500)
committerDenis Kenzior <denkenz@gmail.com>
Wed, 4 Sep 2013 03:58:59 +0000 (22:58 -0500)
So the value might be used directly for D-Bus property emission.
Otherwise D-Bus asserts and screws itself with:
ofonod[7427]: src/sms.c:handle_mwi()
process 7427: arguments to dbus_message_iter_append_basic() were
incorrect, assertion "*bool_p == 0 || *bool_p == 1" failed in file
../../dbus/dbus-message.c line 2549.

src/smsutil.c

index 22d0ea9..be60ee9 100644 (file)
@@ -240,7 +240,7 @@ gboolean sms_mwi_dcs_decode(guint8 dcs, enum sms_mwi_type *type,
        else
                ch = SMS_CHARSET_7BIT;
 
-       act = dcs & 0x8;
+       act = (dcs & 0x8) ? TRUE : FALSE;
 
        t = (enum sms_mwi_type) (dcs & 0x3);