From b5771ff4e22cba18c26cf017d7400bba04d9bf54 Mon Sep 17 00:00:00 2001 From: Anicka Bernathova Date: Fri, 17 Jul 2009 21:34:41 +0200 Subject: [PATCH] fix writing to fd --- ham.c | 10 ++++------ int.c | 1 - 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/ham.c b/ham.c index 714ebc4..6b68404 100644 --- a/ham.c +++ b/ham.c @@ -216,7 +216,6 @@ copy_email(int fd, struct email* email) for (pc = ph->name; *pc; pc++) write_char_to_mailbox(*pc, fd); write_char_to_mailbox(':', fd); - write_char_to_mailbox(' ', fd); for (pc = ph->value; *pc; pc++) write_char_to_mailbox(*pc, fd); write_char_to_mailbox('\n', fd); @@ -280,22 +279,21 @@ write_email_to_fd(int fd, struct email* email) written = write(fd, ph->name, strlen(ph->name)); if (written < strlen(ph->name)) return 1; - written = write(fd, ": ", 2); - if (written < 2) + written = write(fd, ":", 1); + if (written < 1) return 1; written = write(fd, ph->value, strlen(ph->value)); if (written < strlen(ph->value)) return 1; - written = write(fd, "\n", 2); + written = write(fd, "\n", 1); if (written < 1) return 1; } - written = write(fd, "\n", 2); + written = write(fd, "\n", 1); if (written < 1) return 1; /* body */ - if (email->body) { written = write(fd, email->body, email->body_len); if (written < email->body_len) diff --git a/int.c b/int.c index 935a726..d4360c6 100644 --- a/int.c +++ b/int.c @@ -405,7 +405,6 @@ send_mail(char* where, int copy, struct list* hash) int res; struct email em = prepare_email(hash); - //write_email_to_fd(1, &em); res = pipe(pd); if (res < 0) goto end; -- 2.39.2