mirror of
https://git.mirrors.martin98.com/https://github.com/luc-github/ESP3D.git
synced 2025-08-15 01:15:56 +08:00
Update storestrings.cpp
minor refactoring thanks @treeplek
This commit is contained in:
parent
481e6ab6bc
commit
0c306a2aff
@ -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
|
||||||
|
Loading…
x
Reference in New Issue
Block a user