Skip to content
Permalink
Browse files
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.
  • Loading branch information
cvicentiu committed Oct 23, 2020
1 parent 8894dae commit 5a9df15
Showing 1 changed file with 1 addition and 1 deletion.
@@ -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 == ':')
{

0 comments on commit 5a9df15

Please sign in to comment.