diff --git a/src/archive.c b/src/archive.c index 7dc6ed16..2b4ac42b 100644 --- a/src/archive.c +++ b/src/archive.c @@ -203,7 +203,7 @@ CLEANUP: int retrieve_email_from_archive(struct session_data *sdata, FILE *dest, struct __config *cfg){ - int i, rc, attachments; + int i, rc, n, attachments; char *buffer=NULL, *saved_buffer, *p, filename[SMALLBUFSIZE], pointer[SMALLBUFSIZE]; struct ptr_array ptr_arr[MAX_ATTACHMENTS]; @@ -236,7 +236,7 @@ int retrieve_email_from_archive(struct session_data *sdata, FILE *dest, struct _ p = strstr(buffer, pointer); if(p){ *p = '\0'; - fwrite(buffer, 1, p - buffer, dest); + n = fwrite(buffer, 1, p - buffer, dest); buffer = p + strlen(pointer); if(strlen(ptr_arr[i].piler_id) == RND_STR_LEN){ @@ -249,7 +249,7 @@ int retrieve_email_from_archive(struct session_data *sdata, FILE *dest, struct _ } if(buffer){ - fwrite(buffer, 1, strlen(buffer), dest); + n = fwrite(buffer, 1, strlen(buffer), dest); } buffer = saved_buffer; diff --git a/src/parser.c b/src/parser.c index 121cf387..b5017d87 100644 --- a/src/parser.c +++ b/src/parser.c @@ -96,7 +96,7 @@ void post_parse(struct session_data *sdata, struct _state *state, struct __confi int parse_line(char *buf, struct _state *state, struct session_data *sdata, struct __config *cfg){ char *p, *q, puf[SMALLBUFSIZE]; - int x, len, b64_len, boundary_line=0; + int x, n, len, b64_len, boundary_line=0; state->line_num++; len = strlen(buf); @@ -121,13 +121,13 @@ int parse_line(char *buf, struct _state *state, struct session_data *sdata, stru if(state->message_state == MSG_BODY && state->fd != -1 && is_item_on_string(state->boundaries, buf) == 0){ //printf("dumping: %s", buf); - write(state->fd, buf, len); + n = write(state->fd, buf, len); state->attachments[state->n_attachments].size += len; } else { state->saved_size += len; //printf("%s", buf); - write(state->mfd, buf, len); + n = write(state->mfd, buf, len); } @@ -163,7 +163,7 @@ int parse_line(char *buf, struct _state *state, struct session_data *sdata, stru } else { snprintf(puf, sizeof(puf)-1, "ATTACHMENT_POINTER_%s.a%d_XXX_PILER", sdata->ttmpfile, state->n_attachments); - write(state->mfd, puf, strlen(puf)); + n = write(state->mfd, puf, strlen(puf)); //printf("%s", puf); } }