]> mj.ucw.cz Git - umpf.git/commitdiff
fix writing to fd
authorAnicka Bernathova <anicka@anicka.net>
Fri, 17 Jul 2009 19:34:41 +0000 (21:34 +0200)
committerAnicka Bernathova <anicka@anicka.net>
Fri, 17 Jul 2009 19:34:41 +0000 (21:34 +0200)
ham.c
int.c

diff --git a/ham.c b/ham.c
index 714ebc4ae51d69340cec30e0be52eebae524d83c..6b68404fd1c0efe79253856d7d81e5b0e9c3f5df 100644 (file)
--- 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 935a7260dc24fe2a6bf94f85a53f8bc95f70fe11..d4360c6696cb60a5eae84f49c6d4dd7f56a87492 100644 (file)
--- 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;