Added a separator to searching for attachment names

Signed-off-by: Janos SUTO <sj@acts.hu>
This commit is contained in:
Janos SUTO 2020-08-11 20:36:18 +02:00
parent d9ed819b2b
commit f514d68bd1

View File

@ -1063,8 +1063,13 @@ void fill_attachment_name_buf(struct parser_state *state, char *buf){
int len = strlen(p);
if(len + state->anamepos < SMALLBUFSIZE-2){
if(len + state->anamepos < SMALLBUFSIZE-3){
memcpy(&(state->attachment_name_buf[state->anamepos]), p, len);
state->anamepos += len;
// add a trailing separator semicolon to make sure there's separation
// with the next item
state->attachment_name_buf[state->anamepos] = ';';
state->anamepos++;
}
}