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

Reply via email to