Added debug output for file storage

Signed-off-by: tyrolyean <tyrolyean@tyrolyean.net>
This commit is contained in:
tyrolyean 2020-04-30 01:37:41 +02:00
parent 70128ba907
commit 8d75c009ab
No known key found for this signature in database
GPG Key ID: EDD105663B707C62
1 changed files with 5 additions and 0 deletions

View File

@ -128,6 +128,7 @@ int base64_decode_file(const char* directory, const struct email_t* mail){
}
if(exists){
/* What?*/
fprintf(stderr,"Failed to create unique file name!\n");
free(filename);
free(decoded);
return -1;
@ -140,6 +141,10 @@ int base64_decode_file(const char* directory, const struct email_t* mail){
free(decoded);
return -1;
}
if(verbose){
printf("Storing base64 file len %lu top [%s]\n",
dec_len, decoded);
}
fwrite(decoded, dec_len, 1, outfile);
fclose(outfile);