You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I had some code where the input string "in" was not null-terminated for:
size_t shoco_compress(const char * in, size_t len, char * out, size_t bufsize);
Specifically
in := Building.txt/237/245/0
len := 12
shoco_compress encoded the two junk characters /237/245 and returned encoded array of length 10.
By providing a copy of the "in" string with terminating null:
in := Building.txt/0
len := 12
it works fine, returning an encoded string length 8.
Easy work around but I was going off the API description: "If [len is] a positive integer, parsing the input will stop after this length, or at a null-char, whatever comes first." - which doesn't seem to be the case.
Hope this makes sense; and thanks for providing this library.
The text was updated successfully, but these errors were encountered:
I had some code where the input string "in" was not null-terminated for:
size_t shoco_compress(const char * in, size_t len, char * out, size_t bufsize);
Specifically
in := Building.txt/237/245/0
len := 12
shoco_compress encoded the two junk characters /237/245 and returned encoded array of length 10.
By providing a copy of the "in" string with terminating null:
in := Building.txt/0
len := 12
it works fine, returning an encoded string length 8.
Easy work around but I was going off the API description: "If [len is] a positive integer, parsing the input will stop after this length, or at a null-char, whatever comes first." - which doesn't seem to be the case.
Hope this makes sense; and thanks for providing this library.
The text was updated successfully, but these errors were encountered: