summaryrefslogtreecommitdiffstats
path: root/dbus/dbus-sysdeps-util.c
diff options
context:
space:
mode:
authorHavoc Pennington <hp@redhat.com>2007-07-12 22:18:05 +0000
committerHavoc Pennington <hp@redhat.com>2007-07-12 22:18:05 +0000
commited57b9c663db89370055c5196e7e0b537647e9ef (patch)
tree96c4f532c4827b8e3968c9e20acfa804b125af10 /dbus/dbus-sysdeps-util.c
parente339814224d54c9b048ead2d6965f89790ec318a (diff)
2007-07-12 Havoc Pennington <hp@redhat.com>
* dbus/dbus-sysdeps-util.c (_dbus_sysdeps_test): invert the test for parsing hex as double to be sure it fails to work * dbus/dbus-sysdeps.c (_dbus_string_parse_double): don't allow hex numbers.
Diffstat (limited to 'dbus/dbus-sysdeps-util.c')
-rw-r--r--dbus/dbus-sysdeps-util.c16
1 files changed, 3 insertions, 13 deletions
diff --git a/dbus/dbus-sysdeps-util.c b/dbus/dbus-sysdeps-util.c
index 1f6ceb9b..4d1d0daa 100644
--- a/dbus/dbus-sysdeps-util.c
+++ b/dbus/dbus-sysdeps-util.c
@@ -142,20 +142,10 @@ _dbus_sysdeps_test (void)
}
_dbus_string_init_const (&str, "0xff");
- if (!_dbus_string_parse_double (&str,
- 0, &val, &pos))
- {
- _dbus_warn ("Failed to parse double");
- exit (1);
- }
- if (ABS (0xff - val) > 1e-6)
- {
- _dbus_warn ("Failed to parse 0xff correctly, got: %f\n", val);
- exit (1);
- }
- if (pos != 4)
+ if (_dbus_string_parse_double (&str,
+ 0, &val, &pos))
{
- _dbus_warn ("_dbus_string_parse_double of \"0xff\" returned wrong position %d", pos);
+ _dbus_warn ("Should not have parsed hex as double\n");
exit (1);
}