[vlc-commits] misc/json: Fix check for json_relaxed_commas

Marvin Scholz git at videolan.org
Wed Apr 18 20:04:52 CEST 2018


vlc | branch: master | Marvin Scholz <epirat07 at gmail.com> | Thu Mar 29 11:08:45 2018 +0200| [c1801fa481cfe85c9ce13ba468d2d9f334921503] | committer: Marvin Scholz

misc/json: Fix check for json_relaxed_commas

The negation would only apply to the left operand (settings) and not the
full expression, which is likely not what was intended.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=c1801fa481cfe85c9ce13ba468d2d9f334921503
---

 modules/misc/webservices/json.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/modules/misc/webservices/json.c b/modules/misc/webservices/json.c
index 0afc01c614..d34afdeab9 100644
--- a/modules/misc/webservices/json.c
+++ b/modules/misc/webservices/json.c
@@ -374,7 +374,7 @@ json_value * json_parse_ex (json_settings * settings, const json_char * json, ch
 
                   if (top->type == json_array)
                      flags = (flags & ~ (flag_need_comma | flag_seek_value)) | flag_next;
-                  else if (!state.settings.settings & json_relaxed_commas)
+                  else if (!(state.settings.settings & json_relaxed_commas))
                   {  sprintf (error, "%d:%d: Unexpected ]", cur_line, e_off);
                      goto e_failed;
                   }
@@ -529,7 +529,7 @@ json_value * json_parse_ex (json_settings * settings, const json_char * json, ch
 
                   case '"':
 
-                     if (flags & flag_need_comma && (!state.settings.settings & json_relaxed_commas))
+                     if (flags & flag_need_comma && !(state.settings.settings & json_relaxed_commas))
                      {
                         sprintf (error, "%d:%d: Expected , before \"", cur_line, e_off);
                         goto e_failed;



More information about the vlc-commits mailing list