Fixes for value search

Signed-off-by: tyrolyean <tyrolyean@tyrolyean.net>
This commit is contained in:
tyrolyean 2020-04-29 02:06:56 +02:00
parent 646517cc97
commit 238d7d187c
No known key found for this signature in database
GPG key ID: EDD105663B707C62
2 changed files with 2 additions and 0 deletions

View file

@ -44,6 +44,7 @@ struct email_t mail_from_text(char* message, size_t length){
mail.is_multipart = false; mail.is_multipart = false;
return mail; return mail;
}else{ }else{
printf("Content Type set: %.*s",15, cont_type);
size_t value_length = 0; size_t value_length = 0;
char * mime_type = get_value_from_key(&value_length, char * mime_type = get_value_from_key(&value_length,
cont_type - mail.message, &mail); cont_type - mail.message, &mail);

View file

@ -85,6 +85,7 @@ char* get_value_from_key(size_t* val_len, size_t key_offset,
for(size_t i = key_offset; i < mail->header_len; i++){ for(size_t i = key_offset; i < mail->header_len; i++){
if(mail->message[i] == ':'){ if(mail->message[i] == ':'){
colon = i; colon = i;
break;
} }
} }