aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engines/supernova/state.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/engines/supernova/state.cpp b/engines/supernova/state.cpp
index 7e949c0a55..9103a0b1b2 100644
--- a/engines/supernova/state.cpp
+++ b/engines/supernova/state.cpp
@@ -216,11 +216,11 @@ GuiElement::GuiElement()
, _textColorHighlighted(kColorLightGreen)
, _textColor(kColorGreen)
{
- _text[0] = '\0';
+ memset(_text, 0, sizeof(_text));
}
void GuiElement::setText(const char *text) {
- strncpy(_text, text, sizeof(_text));
+ strncpy(_text, text, sizeof(_text) - 1);
}
void GuiElement::setTextPosition(int x, int y) {