Uh oh!
There was an error while loading. Please reload this page.
Fixing errors on Linkshell/Linkpearls/Pearlsacks - #2001
Conversation
This change fixes two errors that happen when Linkshells with certain combinations of characters result in a bitpacked LS name that contains zeroed bytes in the middle. First change detects the length of the name properly, second change fixes the `nil` error.
lili-ffxi
commented
Feb 13, 2021
A better/more elegant/leaner way of doing it is welcome. This was the most basic way I could come up with. |
z16
commented
Feb 13, 2021
If you're sure there is at least one non-null byte (which makes sense, I think? Considering it's only parsed in case of an LS name) you can do this: localname_end=#strwhilestr:byte(name_end) ==0doname_end=name_end-1endIf you want to make sure it's at least 10 you can add |
lili-ffxi
commented
Feb 13, 2021
I famously forget that |
lili-ffxi
commented
Feb 13, 2021
Done. I put the > 10 in, should never actually be needed but I thought it's maybe better safe than sorry. |
z16
commented
Feb 13, 2021
They are usually worth forgetting. |
Fixing errors on Linkshell/Linkpearls/Pearlsacks
This change fixes two errors that happen when parsing Linkshells with certain combinations of characters that result in a bitpacked LS name that contains zeroed bytes in the middle.
First change fixes the
nilerror, second change detects the length of the name properly.