summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVicențiu Ciorbaru <vicentiu@mariadb.org>2020-10-12 13:38:59 +0300
committerVicențiu Ciorbaru <vicentiu@mariadb.org>2020-10-23 19:41:27 +0300
commit5a9df1550f256b7be7aaffbf4cbce13d0ca22566 (patch)
treeafc0fc94436a357abd1de4c795f8bcfeed389434
parent8894dae1df87efda299d2c1fbccc4792c9058f45 (diff)
downloadmariadb-git-5a9df1550f256b7be7aaffbf4cbce13d0ca22566.tar.gz
MDEV-23941: strings/json_lib.c:893:12: style: Suspicious condition
The characters parsed are always ascii characters, hence one byte. This means that the code did not have "incorrect" logic because the boolean condition, if true, would also evaluate to the value of 1. The condition however is semantically wrong, assuming a length is equal to the condition outcome. Change paranthesis to make it also read according to the intent.
-rw-r--r--strings/json_lib.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/strings/json_lib.c b/strings/json_lib.c
index 3ce9b0c503f..3c455c3572c 100644
--- a/strings/json_lib.c
+++ b/strings/json_lib.c
@@ -890,7 +890,7 @@ int json_read_keyname_chr(json_engine_t *j)
case S_QUOTE:
for (;;) /* Skip spaces until ':'. */
{
- if ((c_len= json_next_char(&j->s) > 0))
+ if ((c_len= json_next_char(&j->s)) > 0)
{
if (j->s.c_next == ':')
{