Skip to content

Commit 0c306a2

Browse files
author
Luc
committed
Update storestrings.cpp
minor refactoring thanks @treeplek
1 parent 481e6ab commit 0c306a2

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

esp8266/storestrings.cpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -86,10 +86,7 @@ bool STORESTRINGS_CLASS::add (const char * string){
8686
if (need_resize)
8787
{ //copy maximum length minus 3
8888
strncpy(ptr,string,_maxstringlength-3);
89-
//add nul char
90-
ptr[_maxstringlength-3]='\0';
91-
//add dot to show string was cutted
92-
strcat(ptr,"...");
89+
strcpy(ptr+_maxstringlength-3,"...");
9390
}
9491
else
9592
{ //copy as it is

0 commit comments

Comments
 (0)