[master] 89e2dceb8 fix forgotten VCL_INT limits
Nils Goroll
nils.goroll at uplex.de
Tue Feb 26 21:18:06 UTC 2019
commit 89e2dceb8e92fbe9be9399261245737a4ea3522e
Author: Nils Goroll <nils.goroll at uplex.de>
Date: Tue Feb 26 22:15:53 2019 +0100
fix forgotten VCL_INT limits
we missed to change these when we changed the VCL_INT typedef from long
to int64_t
Should we add VCL_INT_MAX / VCL_INT_MIN (and for the other integer
types, respectively)?
diff --git a/lib/libvmod_std/vmod_std_conversions.c b/lib/libvmod_std/vmod_std_conversions.c
index 659c148c3..a072cf5ef 100644
--- a/lib/libvmod_std/vmod_std_conversions.c
+++ b/lib/libvmod_std/vmod_std_conversions.c
@@ -81,7 +81,7 @@ vmod_integer(VRT_CTX, VCL_STRING p, VCL_INT i)
return (i);
r = trunc(r);
- if (r > LONG_MAX || r < LONG_MIN)
+ if (r > INT64_MAX || r < INT64_MIN)
return (i);
return ((VCL_INT)r);
@@ -158,7 +158,7 @@ vmod_real2integer(VRT_CTX, VCL_REAL r, VCL_INT i)
if (!isfinite(r))
return (i);
r = round(r);
- if (r > LONG_MAX || r < LONG_MIN)
+ if (r > INT64_MAX || r < INT64_MIN)
return(i);
return ((VCL_INT)r);
}
@@ -182,7 +182,7 @@ vmod_time2integer(VRT_CTX, VCL_TIME t, VCL_INT i)
if (!isfinite(t))
return (i);
t = round(t);
- if (t > LONG_MAX || t < LONG_MIN)
+ if (t > INT64_MAX || t < INT64_MIN)
return(i);
return ((VCL_INT)t);
}
More information about the varnish-commit
mailing list