Skip to content

Commit

Permalink
Fix random missing null terminator in Dumps
Browse files Browse the repository at this point in the history
  • Loading branch information
G33kDude committed Jul 5, 2021
1 parent 92aff5d commit 217395f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Src/cJson.ahk
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,10 @@ class cJson
size := 0
DllCall(this.lib.dumps, "Ptr", &obj, "Ptr", 0, "Int*", size
, "Ptr", &this.True, "Ptr", &this.False, "Ptr", &this.Null, "CDecl Ptr")
VarSetCapacity(buf, size*2+1, 0)
VarSetCapacity(buf, size*2+2, 0)
DllCall(this.lib.dumps, "Ptr", &obj, "Ptr*", &buf, "Int*", size
, "Ptr", &this.True, "Ptr", &this.False, "Ptr", &this.Null, "CDecl Ptr")
return StrGet(&buf, size*2, "UTF-16")
return StrGet(&buf, size, "UTF-16")
}

Loads(json)
Expand Down

0 comments on commit 217395f

Please sign in to comment.