Skip to content

Commit

Permalink
vxp: fix vslq_test_rec() for FreeBSD
Browse files Browse the repository at this point in the history
the actual issue was that strtoll(".456", ...) sets errno 22, so when
we fall back to strtod(), we need to clear it.

Ref 0ca8d17
Ref 0dfa3b8

Fixes #4088

Yes, I did install FreeBSD, and it's been a nice refreshing no-frills experience
so far.
  • Loading branch information
nigoroll committed Jun 5, 2024
1 parent 8b4c7a1 commit d3db146
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions lib/libvarnishapi/vsl_query.c
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,7 @@ vslq_test_rec(const struct vex *vex, const struct VSLC_ptr *rec)
lhs_int = strtoll(b, &q, 0);
AN(q);
if (q != e && (*q == '.' || *q == 'e')) {
errno = 0;
lhs_float = strtod(b, &q);
lhs_int = (long long)lhs_float;
lhs_float = 0.;
Expand Down

0 comments on commit d3db146

Please sign in to comment.