Skip to content

Commit

Permalink
fix version check
Browse files Browse the repository at this point in the history
  • Loading branch information
rfomin committed Sep 15, 2024
1 parent 036af1d commit 6143dd5
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/m_json.c
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,11 @@ json_t *JS_Open(const char *type, version_t version, const char *data)
s = JS_GetString(js_version);
version_t v = {0};
sscanf(s, "%d.%d.%d", &v.major, &v.minor, &v.revision);
if (v.major != version.major || v.minor != version.minor
|| v.revision != version.revision)
if (!(v.major == version.major && v.minor == version.minor
&& v.revision == version.revision))
{
I_Printf(VB_ERROR, "%s: wrong version %d.%d.%d", type, v.major, v.minor,
v.revision);
I_Printf(VB_ERROR, "%s: unsupported version %d.%d.%d", type, v.major,
v.minor, v.revision);
return NULL;
}

Expand Down

0 comments on commit 6143dd5

Please sign in to comment.