mirror of
https://github.com/ZDoom/qzdoom-gpl.git
synced 2024-12-02 08:22:25 +00:00
- fixed: FString::StripRight's space checking counter was broken and would cause deletion of the last valid character in the string.
This commit is contained in:
parent
5085954041
commit
e651833943
1 changed files with 3 additions and 3 deletions
|
@ -696,7 +696,7 @@ void FString::StripRight ()
|
||||||
{
|
{
|
||||||
size_t max = Len(), i;
|
size_t max = Len(), i;
|
||||||
if (max == 0) return;
|
if (max == 0) return;
|
||||||
for (i = --max; i-- > 0; )
|
for (i = --max; i > 0; i--)
|
||||||
{
|
{
|
||||||
if (!isspace((unsigned char)Chars[i]))
|
if (!isspace((unsigned char)Chars[i]))
|
||||||
break;
|
break;
|
||||||
|
@ -728,12 +728,12 @@ void FString::StripRight (const char *charset)
|
||||||
{
|
{
|
||||||
size_t max = Len(), i;
|
size_t max = Len(), i;
|
||||||
if (max == 0) return;
|
if (max == 0) return;
|
||||||
for (i = --max; i-- > 0; )
|
for (i = --max; i > 0; i--)
|
||||||
{
|
{
|
||||||
if (!strchr (charset, Chars[i]))
|
if (!strchr (charset, Chars[i]))
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (i == max)
|
if (i == max-1)
|
||||||
{ // Nothing to strip.
|
{ // Nothing to strip.
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue