From 0c306a2aff6bf32b3a793b696e1a170de5dadaab Mon Sep 17 00:00:00 2001 From: Luc Date: Mon, 25 Jan 2016 13:50:05 +0800 Subject: [PATCH] Update storestrings.cpp minor refactoring thanks @treeplek --- esp8266/storestrings.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/esp8266/storestrings.cpp b/esp8266/storestrings.cpp index 0a2d5eede..28a760e8e 100644 --- a/esp8266/storestrings.cpp +++ b/esp8266/storestrings.cpp @@ -86,10 +86,7 @@ bool STORESTRINGS_CLASS::add (const char * string){ if (need_resize) { //copy maximum length minus 3 strncpy(ptr,string,_maxstringlength-3); - //add nul char - ptr[_maxstringlength-3]='\0'; - //add dot to show string was cutted - strcat(ptr,"..."); + strcpy(ptr+_maxstringlength-3,"..."); } else { //copy as it is