Update storestrings.cpp

minor refactoring thanks @treeplek
This commit is contained in:
Luc 2016-01-25 13:50:05 +08:00
parent 481e6ab6bc
commit 0c306a2aff

View File

@ -86,10 +86,7 @@ bool STORESTRINGS_CLASS::add (const char * string){
if (need_resize) if (need_resize)
{ //copy maximum length minus 3 { //copy maximum length minus 3
strncpy(ptr,string,_maxstringlength-3); strncpy(ptr,string,_maxstringlength-3);
//add nul char strcpy(ptr+_maxstringlength-3,"...");
ptr[_maxstringlength-3]='\0';
//add dot to show string was cutted
strcat(ptr,"...");
} }
else else
{ //copy as it is { //copy as it is