Using strncat instead

This commit is contained in:
Magnus Persson 2022-08-04 16:17:24 +02:00
parent 09d8226af1
commit 45294f6b07

View File

@ -88,7 +88,7 @@ class TemplatingEngine {
{TPL_TOKEN2, ""}, {TPL_APP_VER, ""}, {TPL_TOKEN2, ""}, {TPL_APP_VER, ""},
{TPL_APP_BUILD, ""}}; {TPL_APP_BUILD, ""}};
char _buffer[20]; char _buffer[20] = "";
String _baseTemplate; String _baseTemplate;
char *_output = 0; char *_output = 0;
@ -153,13 +153,13 @@ class TemplatingEngine {
_items[i].key.length()) == 0) { _items[i].key.length()) == 0) {
// Found key // Found key
strncat(_output, format + k, j - k); strncat(_output, format + k, j - k);
strcat(_output, _items[i].val.c_str()); strncat(_output, _items[i].val.c_str(), _items[i].val.length());
k = j + _items[i].key.length(); k = j + _items[i].key.length();
} }
} }
} }
} }
strcat(_output, format + k); strncat(_output, format + k, strlen(format + k));
} }
void dumpAll() { void dumpAll() {