[Github-comments] [geany/geany-plugins] scope: Fix validate_number() (#419)

Jiří Techet notifications at xxxxx
Tue Mar 29 13:12:16 UTC 2016


The brackets are apparently wrong - the check that should happen is

strcmp(text, "2147483648") < 0

but instead the whole expression

(s - text == 10 && strcmp(text, "2147483648"))

is compared if it's less than zero.

Noticed by LLVM:

utils.c:654:50: warning: comparison of constant 0 with boolean expression is always false
      [-Wtautological-constant-out-of-range-compare]
                (s - text == 10 && strcmp(text, "2147483648")) < 0) ? text : NULL;
                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^ ~
You can view, comment on, or merge this pull request online at:

  https://github.com/geany/geany-plugins/pull/419

-- Commit Summary --

  * scope: Fix validate_number()

-- File Changes --

    M scope/src/utils.c (2)

-- Patch Links --

https://github.com/geany/geany-plugins/pull/419.patch
https://github.com/geany/geany-plugins/pull/419.diff

---
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/geany/geany-plugins/pull/419
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.geany.org/pipermail/github-comments/attachments/20160329/53f83662/attachment.html>


More information about the Github-comments mailing list