From de448e64862babc8ea92d6ee3f61f68ba3915128 Mon Sep 17 00:00:00 2001 From: markus schnalke Date: Fri, 3 Feb 2012 17:02:11 +0100 Subject: [PATCH] Removed unused parameter from mbx_copy(). --- h/dropsbr.h | 2 +- uip/dropsbr.c | 11 ++--------- uip/packf.c | 3 +-- uip/rcvpack.c | 2 +- uip/slocal.c | 3 +-- 5 files changed, 6 insertions(+), 15 deletions(-) diff --git a/h/dropsbr.h b/h/dropsbr.h index 2349dbb..2b21f10 100644 --- a/h/dropsbr.h +++ b/h/dropsbr.h @@ -6,5 +6,5 @@ ** prototypes */ int mbx_open(char *, uid_t, gid_t, mode_t); -int mbx_copy(char *, int, int, char *, int); +int mbx_copy(char *, int, int, int); int mbx_close(char *, int); diff --git a/uip/dropsbr.c b/uip/dropsbr.c index 007186e..dd7a2df 100644 --- a/uip/dropsbr.c +++ b/uip/dropsbr.c @@ -104,7 +104,7 @@ mbx_open(char *file, uid_t uid, gid_t gid, mode_t mode) ** Append message to end of file or maildrop. */ int -mbx_copy(char *mailbox, int md, int fd, char *text, int noisy) +mbx_copy(char *mailbox, int md, int fd, int noisy) { int i, j; off_t start, stop; @@ -122,18 +122,11 @@ mbx_copy(char *mailbox, int md, int fd, char *text, int noisy) } start = lseek(md, (off_t) 0, SEEK_CUR); - /* If text is given, we add it to top of message */ - if (text) { - i = strlen(text); - if (write(md, text, i) != i) - return NOTOK; - } - for (j = 0; fgets(buffer, sizeof(buffer), fp) != NULL; j++) { /* ** Check the first line, and make some changes. */ - if (j == 0 && !text) { + if (j == 0) { /* ** Change the "Return-Path:" field ** (if in first line) back to "From ". diff --git a/uip/packf.c b/uip/packf.c index 071cc3d..62c09da 100644 --- a/uip/packf.c +++ b/uip/packf.c @@ -145,8 +145,7 @@ main(int argc, char **argv) break; } - if (mbx_copy(file, md, fd, NULL, 1) - == NOTOK) + if (mbx_copy(file, md, fd, 1) == NOTOK) adios(file, "error writing to file"); close(fd); diff --git a/uip/rcvpack.c b/uip/rcvpack.c index fd1c2aa..85de619 100644 --- a/uip/rcvpack.c +++ b/uip/rcvpack.c @@ -78,7 +78,7 @@ main(int argc, char **argv) done(RCV_MBX); /* append the message */ - if (mbx_copy(file, md, fileno(stdin), NULL, 0) == NOTOK) { + if (mbx_copy(file, md, fileno(stdin), 0) == NOTOK) { mbx_close(file, md); done(RCV_MBX); } diff --git a/uip/slocal.c b/uip/slocal.c index 7b148e8..7546cdd 100644 --- a/uip/slocal.c +++ b/uip/slocal.c @@ -1068,8 +1068,7 @@ usr_file(int fd, char *mailbox) lseek(fd, (off_t) 0, SEEK_SET); /* append message to file */ - if (mbx_copy(mailbox, md, fd, NULL, verbose) - == -1) { + if (mbx_copy(mailbox, md, fd, verbose) == -1) { if (verbose) adorn("", "error writing to:"); return -1; -- 1.7.10.4