-
-
Notifications
You must be signed in to change notification settings - Fork 498
Fix #1443 - trim teaEncode trailing zeroes #1534
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
I can't connect to my 1.5.6 server, for some stupid reason(a resource sets min client version, and I cant figure out which one)
Please, could someone run a few tests, and post the results here on 1.5.6 server and client?
Test values:
- 123
- 1234
- 0円0円Hello
- 1230円
- hithere0円0円0円0円
- 0円hi0円
- 0円0円0円0円0円hi0円0円
- 1230円0円0円0円
They key can be anything. Let it be.. "c++20"
@Pirulax mtaserver.conf:
<minclientversion></minclientversion>
<minclientversion_auto_update>0</minclientversion_auto_update>
Edit: Oh a resource sets it - Nevermind
btw, the problem is that, now I've fixed en/decodeString as well, which has been returning wrong values since it was introduced. Should we keep backwards compatibility? Or just hope nobody tries comparing decoded strings?
Btw, since the old one used strnlen it strips all padding from the end, so I'll modify this one to be like that.
@Pirulax mtaserver.conf:
<minclientversion></minclientversion> <minclientversion_auto_update>0</minclientversion_auto_update>Edit: Oh a resource sets it - Nevermind
Actually, I'm not sure if it was a resource. I think this'll help, thanks!
New resource to test: utf1443.zip
We need to fix the padding in teaEncode, because with binary files 0's at the file end is totally acceptable.
50bb813 to
bc84f8e
Compare
Perhaps, maybe add a noTrim argument?
Lets try and fix the regression in this PR and we can discuss other problems with teaEncode in a separate issue.
Lets try and fix the regression in this PR and we can discuss other problems with teaEncode in a separate issue.
Agreed. Let's get this fixed yesterday
Uh oh!
There was an error while loading. Please reload this page.
So basically, with the introduction of sbx's new parser, we started returning strings with
lua_pushlstring, which takes a length as an argument, thus pushes the whole string along with padding. The old method usedlua_pushstringwhich usedstrlen, thus god rid of the padding.This PR fixes #1443 .
Edit: test resource: utf1443.zip