]> git.ipfire.org Git - thirdparty/plymouth.git/commitdiff
[script] do abs(x) > epsilon instead of x != 0
authorRay Strode <rstrode@redhat.com>
Thu, 6 Aug 2009 03:09:02 +0000 (23:09 -0400)
committerRay Strode <rstrode@redhat.com>
Thu, 6 Aug 2009 03:09:02 +0000 (23:09 -0400)
Fixes a compiler warning.

src/plugins/splash/script/script-object.c

index 089a0e10e070f227766b29e8e99a72480d695fbd..3a9ef4c78047eea711e9b711a85886886310d50f 100644 (file)
@@ -31,6 +31,7 @@
 #include <string.h>
 #include <stdbool.h>
 #include <math.h>
+#include <values.h>
 
 #include "script.h"
 #include "script-object.h"
@@ -285,7 +286,7 @@ bool script_obj_as_bool (script_obj_t *obj)
         return false;
 
       case SCRIPT_OBJ_TYPE_FLOAT:
-        if (obj->data.floatpoint) return true;
+        if (fabs (obj->data.floatpoint) > FLT_MIN) return true;
         return false;
 
       case SCRIPT_OBJ_TYPE_NULL: