From: Baptiste Daroussin Date: Sat, 15 Apr 2023 19:24:24 +0000 (+0200) Subject: do_all_the_voodoo_here: avoid intermediary variable X-Git-Tag: RELEASE_1_4_0b1~11 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c90dac8b8dd2db89573741e93921f18bc7be19af;p=thirdparty%2Fmlmmj.git do_all_the_voodoo_here: avoid intermediary variable --- diff --git a/src/do_all_the_voodoo_here.c b/src/do_all_the_voodoo_here.c index 7b50d15e..c83e3ea2 100644 --- a/src/do_all_the_voodoo_here.c +++ b/src/do_all_the_voodoo_here.c @@ -78,8 +78,7 @@ int do_all_the_voodoo_here(int infd, int outfd, int hdrfd, int footfd, char *hdrline, *unfolded, *unqp; bool hdrsadded = false; bool subject_present = false; - int localfd = dup(infd); - FILE *f = fdopen(localfd, "r"); + FILE *f = fdopen(dup(infd), "r"); for(;;) { hdrline = gethdrline(f, &unfolded); @@ -152,9 +151,9 @@ int do_all_the_voodoo_here(int infd, int outfd, int hdrfd, int footfd, free(unfolded); } - lseek(localfd, ftello(f), SEEK_SET); + lseek(infd, ftello(f), SEEK_SET); /* Just print the rest of the mail */ - if(dumpfd2fd(localfd, outfd) < 0) { + if(dumpfd2fd(infd, outfd) < 0) { log_error(LOG_ARGS, "Error when dumping rest of mail"); return -1; }