[OpenSIPS-Devel] [opensips] math_eval() does not handle negative numbers (#788)

Liviu Chircu notifications at github.com
Wed Feb 17 14:17:07 CET 2016


> What are you thoughts on using something like TinyExpr from https://github.com/codeplea/tinyexpr ?

I think it's more than a reasonable solution, especially since it's easy to use (1 file + 1 header). I only wrote our own quick parser because I didn't want to impose too many dependencies, but the fact that `TinyExpr` is zlib licenced code is another reason to go with it! All in all, I'm all for the switch to `TinyExpr`.

> if ($(var(temp){s.int}) < 0) {
> ...

This looks like a limitation - we definitely need to make `{s.int}` more permissive with such input, since it should have easily grabbed the `-2` part, even if the input string were `"-2.foobar"`.


---
Reply to this email directly or view it on GitHub:
https://github.com/OpenSIPS/opensips/issues/788#issuecomment-185199872
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opensips.org/pipermail/devel/attachments/20160217/2698b3ee/attachment.htm>


More information about the Devel mailing list