Skip to content

Commit

Permalink
- FString fixes.
Browse files Browse the repository at this point in the history
  • Loading branch information
coelckers committed Jan 7, 2023
1 parent 121e0bd commit 1615b60
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions source/common/utility/zstring.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -843,7 +843,7 @@ void FString::StripLeftRight ()
}
for (j = max - 1; j >= i; --j)
{
if (Chars[i] < 0 || !isspace((unsigned char)Chars[j]))
if (Chars[j] < 0 || !isspace((unsigned char)Chars[j]))
break;
}
if (i == 0 && j == max - 1)
Expand All @@ -863,7 +863,7 @@ void FString::StripLeftRight ()
{
FStringData *old = Data();
AllocBuffer(j - i + 1);
StrCopy(Chars, old->Chars(), j - i + 1);
StrCopy(Chars, old->Chars() + i, j - i + 1);
old->Release();
}
}
Expand Down Expand Up @@ -899,8 +899,8 @@ void FString::StripLeftRight (const char *charset)
else
{
FStringData *old = Data();
AllocBuffer (j - i);
StrCopy (Chars, old->Chars(), j - i);
AllocBuffer (j - i + 1);
StrCopy (Chars, old->Chars() + i, j - i + 1);
old->Release();
}
}
Expand Down

0 comments on commit 1615b60

Please sign in to comment.