Skip to content

Commit 5a9df15

Browse files
committed
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.
1 parent 8894dae commit 5a9df15

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

strings/json_lib.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -890,7 +890,7 @@ int json_read_keyname_chr(json_engine_t *j)
890890
case S_QUOTE:
891891
for (;;) /* Skip spaces until ':'. */
892892
{
893-
if ((c_len= json_next_char(&j->s) > 0))
893+
if ((c_len= json_next_char(&j->s)) > 0)
894894
{
895895
if (j->s.c_next == ':')
896896
{

0 commit comments

Comments
 (0)