[master] da8f0f0 Use isnan() rather than !isfinite()
Poul-Henning Kamp
phk at FreeBSD.org
Tue Feb 24 09:53:08 CET 2015
commit da8f0f0122cf88e134f8b2b841ace62c14e8afd0
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date: Tue Feb 24 08:51:49 2015 +0000
Use isnan() rather than !isfinite()
diff --git a/lib/libvarnish/vnum.c b/lib/libvarnish/vnum.c
index 5635e45..e620223 100644
--- a/lib/libvarnish/vnum.c
+++ b/lib/libvarnish/vnum.c
@@ -119,7 +119,7 @@ VNUM_2bytes(const char *p, uintmax_t *r, uintmax_t rel)
return (err_miss_num);
fval = VNUMpfx(p, &end);
- if (!isfinite(fval))
+ if (isnan(fval))
return (err_invalid_num);
if (end == NULL) {
diff --git a/lib/libvmod_std/vmod_std_conversions.c b/lib/libvmod_std/vmod_std_conversions.c
index e201eb9..57889b0 100644
--- a/lib/libvmod_std/vmod_std_conversions.c
+++ b/lib/libvmod_std/vmod_std_conversions.c
@@ -66,7 +66,7 @@ vmod_duration(VRT_CTX, VCL_STRING p, VCL_DURATION d)
r = VNUMpfx(p, &e);
- if (!isfinite(r) || e == NULL)
+ if (isnan(r) || e == NULL)
return (d);
while(isspace(*e))
@@ -177,7 +177,7 @@ vmod_real(VRT_CTX, VCL_STRING p, VCL_REAL d)
r = VNUM(p);
- if (!isfinite(r))
+ if (isnan(r))
return (d);
return (r);
More information about the varnish-commit
mailing list