Skip to content

Commit a9855bd

Browse files
committed
1. Fix ParseObject bug.
2. Code formatting of #region.
1 parent 5b8fa2f commit a9855bd

File tree

4 files changed

+21
-33
lines changed

4 files changed

+21
-33
lines changed

ChangeLog.md

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,20 @@
1-
## C# v1.2.2
2-
_`2020.2.28 UTC+8 10:50`_
3-
* Change the `Data` type from `class` to `struct`, and use `ref` to pass it.
4-
* Use keyword `out` inline to follow the compiler hits.
1+
## v1.2.3
2+
_`2021.2.5 UTC+8 10:13`_
3+
* **The C Code**
4+
* Fix the parse key bug of ParseObject.
5+
6+
* **The C# Code**
7+
* Code formatting of #region.
58

9+
## v1.2.2
10+
_`2020.2.28 UTC+8 10:50`_
11+
* **The C# Code**
12+
* Change the `Data` type from `class` to `struct`, and use `ref` to pass it.
13+
* Use keyword `out` inline to follow the compiler hits.
614

7-
## C v1.2.0
815
_`2020.1.10 UTC+8 11:35`_
9-
* Add the C code implementation.
16+
* **The C Code**
17+
* Add the C code implementation.
1018

1119

1220
## v1.2.0

Json.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@
77
* GitHub : https://github.com/scottcgi/MojoJson
88
*
99
* Since : 2013-5-29
10-
* Update : 2020-1-8
10+
* Update : 2021-2-6
1111
* Author : scott.cgi
12-
* Version: 1.2.0
12+
* Version: 1.2.3
1313
*/
1414

1515

@@ -798,7 +798,7 @@ static JsonValue* ParseObject(const char** jsonPtr)
798798

799799
const char* strStart;
800800
int keyLen = SkipString(jsonPtr, &strStart);
801-
char key[keyLen];
801+
char key[keyLen + 1];
802802
// make string end
803803
key[keyLen] = '\0';
804804

Json.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@
77
* GitHub : https://github.com/scottcgi/MojoJson
88
*
99
* Since : 2013-1-26
10-
* Update : 2020-1-8
10+
* Update : 2021-2-6
1111
* Author : scott.cgi
12-
* Version: 1.2.0
12+
* Version: 1.2.3
1313
*/
1414

1515

MojoJson.cs

Lines changed: 2 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
* Since : 2017-9-6
1010
* Update : 2020-2-28
1111
* Author : scott.cgi
12-
* Version: 1.2.2
12+
* Version: 1.2.3
1313
*/
1414

1515
using System.Collections.Generic;
@@ -26,8 +26,6 @@ public static class Json
2626

2727

2828
#region Parse Json API
29-
30-
3129
/// <summary>
3230
/// Parse json string.
3331
/// </summary>
@@ -44,14 +42,10 @@ public static void SetEscapeString(bool isEscapeString)
4442
{
4543
Json.isEscapeString = isEscapeString;
4644
}
47-
48-
4945
#endregion
5046

5147

5248
#region Parse Json
53-
54-
5549
/// <summary>
5650
/// Parse the JsonValue.
5751
/// </summary>
@@ -574,8 +568,6 @@ private static char GetUnicodeCodePoint(ref Data data)
574568
(data.unicode[3] )
575569
);
576570
}
577-
578-
579571
#endregion
580572

581573

@@ -630,8 +622,6 @@ public JsonValue(JsonType type, float value)
630622

631623

632624
#region JsonObject API
633-
634-
635625
/// <summary>
636626
/// Use JsonValue as JsonObject.
637627
/// </summary>
@@ -803,14 +793,10 @@ public bool AsObjectGetIsNull(string key)
803793

804794
return false;
805795
}
806-
807-
808796
#endregion
809797

810798

811799
#region JsonArray API
812-
813-
814800
/// <summary>
815801
/// Use JsonValue as JsonArray.
816802
/// </summary>
@@ -892,14 +878,10 @@ public bool AsArrayGetIsNull(int index)
892878
{
893879
return this.AsArrayGet(index).IsNull();
894880
}
895-
896-
897881
#endregion
898882

899883

900-
#region Other Json value API
901-
902-
884+
#region Other Json Value API
903885
/// <summary>
904886
/// Get JsonValue as string.
905887
/// </summary>
@@ -947,8 +929,6 @@ public bool IsNull()
947929
{
948930
return this.type == JsonType.Null;
949931
}
950-
951-
952932
#endregion
953933
}
954934

0 commit comments

Comments
 (0)