Merge "Fix truncate string on STRCP_TO macro."

This commit is contained in:
Zuul 2018-09-06 18:06:43 +00:00 committed by Gerrit Code Review
commit 7a24c8a1d5

View File

@ -42,7 +42,7 @@ static stoi_t err_to_int;
((str).length()==1 && ((str).c_str())[0]==' ')) { \ ((str).length()==1 && ((str).c_str())[0]==' ')) { \
memset(charb,0,sizeof(charb)); \ memset(charb,0,sizeof(charb)); \
} else { \ } else { \
strncpy((charb),str.c_str(),sizeof(charb)); \ snprintf(charb, sizeof(charb)-1, "%s", str.c_str()); \
} }
void add_both_tables(int id, const char *str, itos_t &t1,stoi_t &t2 ) { void add_both_tables(int id, const char *str, itos_t &t1,stoi_t &t2 ) {