Files
VVVVVV/desktop_version/src
AllyTally ca0bfcfa80 Fix undefined behavior while loading scripts
In `editor.cpp`, there's a few sections of code that try and index stuff using `string.length()-1`.
This causes issues where if the string is empty, the result is -1, causing undefined behavior.
Flibit fixed a few of these cases, like on line `375` of editor.cpp:
`if((int) tstring.length() - 1 >= 0) // FIXME: This is sketchy. -flibit`
It turns out that one of these weren't caught, over at line `471`.
`tstring=tstring[tstring.length()-1];`
This causes builds compiled on Windows to segfault if you load more than one level in the editor.
I added a quick `if` around it, setting `tstring` to an empty string, which seems to fix the problem.
2020-02-07 23:30:49 -05:00
..
2020-01-11 08:53:32 -05:00
2020-01-08 10:37:50 -05:00
2020-01-08 10:37:50 -05:00
2020-01-08 10:37:50 -05:00
2020-01-08 10:37:50 -05:00
2020-01-08 10:37:50 -05:00
2020-01-31 15:53:29 -08:00
2020-01-08 10:37:50 -05:00
2020-01-08 10:37:50 -05:00
2020-01-11 08:53:32 -05:00
2020-01-08 10:37:50 -05:00
2020-01-08 10:37:50 -05:00
2020-01-08 10:37:50 -05:00
2020-01-08 10:37:50 -05:00
2020-01-08 10:37:50 -05:00
2020-01-08 10:37:50 -05:00
2020-01-13 11:27:16 -05:00
2020-01-08 10:37:50 -05:00
2020-01-08 10:37:50 -05:00
2020-01-08 10:37:50 -05:00
2020-01-08 10:37:50 -05:00
2020-01-08 10:37:50 -05:00
2020-01-08 10:37:50 -05:00
2020-01-08 10:37:50 -05:00
2020-01-08 10:37:50 -05:00
2020-01-08 10:37:50 -05:00
2020-01-13 23:31:14 -05:00
2020-01-08 10:37:50 -05:00
2020-01-08 10:37:50 -05:00
2020-01-08 10:37:50 -05:00
2020-01-08 10:37:50 -05:00
2020-01-08 10:37:50 -05:00