Fix truncate string on STRCP_TO macro.
The macro STRCP_TO copies a c_str into a char buffer, it won't copy more that sizeof(charb), however, the resulting string will be truncated. Although this is expected, the resulting string won't have a NULL terminator. Story: 2003497 Task: 24774 Change-Id: I249c75af897ba02837ad6d3981d976c291e88aea Signed-off-by: Erich Cordoba <erich.cordoba.malibran@intel.com>
This commit is contained in:
parent
c8159ea6cb
commit
586369fa6d
@ -42,7 +42,7 @@ static stoi_t err_to_int;
|
||||
((str).length()==1 && ((str).c_str())[0]==' ')) { \
|
||||
memset(charb,0,sizeof(charb)); \
|
||||
} 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 ) {
|
||||
|
Loading…
Reference in New Issue
Block a user