Skip to content

Commit f7f67b5

Browse files
committed
fix: pl_json.h empty array issues (v1.0.4)
1 parent b975315 commit f7f67b5

2 files changed

Lines changed: 7 additions & 3 deletions

File tree

docs/version.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ the API is complete. It just means we won't break what currently exists.
4242

4343
## Libraries
4444
* Data Structures v1.0.1 (pl_ds.h)
45-
* Json v1.0.3 (pl_json.h)
45+
* Json v1.0.4 (pl_json.h)
4646
* Logging v1.0.1 (pl_log.h)
4747
* Math v1.2.1 (pl_math.h)
4848
* Memory Allocators v1.1.2 (pl_memory.h)

libs/pl_json.h

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313
*/
1414

1515
// library version (format XYYZZ)
16-
#define PL_JSON_VERSION "1.0.3"
17-
#define PL_JSON_VERSION_NUM 10003
16+
#define PL_JSON_VERSION "1.0.4"
17+
#define PL_JSON_VERSION_NUM 10004
1818

1919
/*
2020
Index of this file:
@@ -864,6 +864,10 @@ pl_load_json(const char* pcJson, plJsonObject** pptJsonOut)
864864
if(tNewJsonObject.tType == PL_JSON_TYPE_ARRAY)
865865
{
866866
uCurrentTokenIndex++;
867+
if(tNewJsonObject.uChildCount == 0) // empty array fix
868+
{
869+
pl_sb_json_pop(sbtObjectStack);
870+
}
867871
}
868872
}
869873
break;

0 commit comments

Comments
 (0)