prevent CNAME/PTR parsing from reading data past the response end
[musl] / src / complex / casinf.c
index cb9863f..2cda2f0 100644 (file)
@@ -1,4 +1,4 @@
-#include "libm.h"
+#include "complex_impl.h"
 
 // FIXME
 
@@ -9,6 +9,7 @@ float complex casinf(float complex z)
 
        x = crealf(z);
        y = cimagf(z);
-       w = cpackf(1.0 - (x - y)*(x + y), -2.0*x*y);
-       return clogf(cpackf(-y, x) + csqrtf(w));
+       w = CMPLXF(1.0 - (x - y)*(x + y), -2.0*x*y);
+       float complex r = clogf(CMPLXF(-y, x) + csqrtf(w));
+       return CMPLXF(cimagf(r), -crealf(r));
 }