This might be tricky to reproduce but here goes.
1) Type some garbage commands into the console, 2 or 3 will work, they can be nonsensical like "dfjgrogjreorejht" and "foeroioqjwgh" (yes literally just mash the keyboard)
2) Hit the up arrow, and then left arrow a few times to edit your gibberish.
3) Hit Backspace or Del - doesn't matter, delete characters from the middle of the line.
4) Weird things start to happen - your line suddenly gets extra characters on it, the string in the edit box is not properly null-terminated.
[Not sure when] Editing console commands no 0x00 at end
Moderator: GZDoom Developers
Forum rules
Please don't bump threads here if you have a problem - it will often be forgotten about if you do. Instead, make a new thread here.
Please don't bump threads here if you have a problem - it will often be forgotten about if you do. Instead, make a new thread here.
Re: [Not sure when] Editing console commands no 0x00 at end
In fact the string is zero terminated however it also has junk character(s) at the end.
This is not the problem of console itself but rather an issue with removal function.
I added clearing of characters beyond string's end in this PR.
This is not the problem of console itself but rather an issue with removal function.
I added clearing of characters beyond string's end in this PR.
-
Edward-san
- Posts: 1774
- Joined: Sat Oct 17, 2009 9:40 am
Re: [Not sure when] Editing console commands no 0x00 at end
Isn't it sufficient to just do "Chars[Len() - remlen] = 0;'?
Re: [Not sure when] Editing console commands no 0x00 at end
Probably yes but I didn't check all other functions honestly so I made it in the safest way.
