diff options
author | Daniel Friesel <derf@finalrewind.org> | 2016-01-22 19:10:25 +0100 |
---|---|---|
committer | Daniel Friesel <derf@finalrewind.org> | 2016-01-22 19:11:08 +0100 |
commit | 8a52cb49c008144e286c482c6036e029ec094ba9 (patch) | |
tree | 08455af92dbb2ac43c1b075fcbb8cc6db7e043d9 | |
parent | 721c5132048a84af2005f6ba2f3ffb59c3354d41 (diff) |
Fix string receive (set trailing null byte in setString)
-rw-r--r-- | src/display.cc | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/display.cc b/src/display.cc index 2059c9b..3bffacd 100644 --- a/src/display.cc +++ b/src/display.cc @@ -101,10 +101,12 @@ void Display::setString(const char *new_str) void Display::setString(char *new_str) { + int i; reset(); - for (uint8_t i = 0; new_str[i] != 0; i++) { + for (i = 0; new_str[i] != 0; i++) { string[i] = new_str[i]; } + string[i] = 0; // trailing null byte } /* |