prevent CNAME/PTR parsing from reading data past the response end
[musl] / src / math / fabs.c
index 6e28f1e..e8258cf 100644 (file)
@@ -1,10 +1,9 @@
-#include "libm.h"
+#include <math.h>
+#include <stdint.h>
 
 double fabs(double x)
 {
-       union dshape u;
-
-       u.value = x;
-       u.bits &= (uint64_t)-1 / 2;
-       return u.value;
+       union {double f; uint64_t i;} u = {x};
+       u.i &= -1ULL/2;
+       return u.f;
 }