Permalink
Browse files

Fix incorrect uses of String(char[])

  • Loading branch information...
mniip committed May 4, 2018
1 parent d6a92bd commit 1485ae5a2178d649b5ba0064ef47b1a72a808e23
Showing with 4 additions and 5 deletions.
  1. +1 −1 src/client/GameSave.cpp
  2. +3 −4 src/gui/interface/Window.cpp
@@ -1947,7 +1947,7 @@ void GameSave::readPSv(char * saveDataChar, int dataLength)
x = 254;
memcpy(tempSignText, data+p, x);
tempSignText[x] = 0;
tempSign.text = format::CleanString(tempSignText, true, true, true).Substr(0, 45);
tempSign.text = format::CleanString(ByteString(tempSignText).FromUtf8(), true, true, true).Substr(0, 45);
tempSigns.push_back(tempSign);
p += x;
}
@@ -227,11 +227,10 @@ void Window::DoDraw()
{
int xPos = focusedComponent_->Position.X+focusedComponent_->Size.X+5+Position.X;
Graphics * g = ui::Engine::Ref().g;
char tempString[512];
char tempString2[512];
String tempString, tempString2;
sprintf(tempString, "Position: L %d, R %d, T: %d, B: %d", focusedComponent_->Position.X, Size.X-(focusedComponent_->Position.X+focusedComponent_->Size.X), focusedComponent_->Position.Y, Size.Y-(focusedComponent_->Position.Y+focusedComponent_->Size.Y));
sprintf(tempString2, "Size: %d, %d", focusedComponent_->Size.X, focusedComponent_->Size.Y);
tempString = String::Build("Position: L ", focusedComponent_->Position.X, ", R ", Size.X-(focusedComponent_->Position.X+focusedComponent_->Size.X), ", T: ", focusedComponent_->Position.Y, ", B: ", Size.Y-(focusedComponent_->Position.Y+focusedComponent_->Size.Y));
tempString2 = String::Build("Size: ", focusedComponent_->Size.X, ", ", focusedComponent_->Size.Y);
if (Graphics::textwidth(tempString)+xPos > WINDOWW)
xPos = WINDOWW-(Graphics::textwidth(tempString)+5);

0 comments on commit 1485ae5

Please sign in to comment.