diff options
author | Jacek Masiulaniec <jacekm@cvs.openbsd.org> | 2009-12-16 21:40:02 +0000 |
---|---|---|
committer | Jacek Masiulaniec <jacekm@cvs.openbsd.org> | 2009-12-16 21:40:02 +0000 |
commit | 71eeb3b4f3b2d98cd20aab9517c0ac638a161325 (patch) | |
tree | 6165b2c299222d84c5021fd79991b464038323fa /usr.sbin/smtpd/client.c | |
parent | 19afedf6388bbbeefa92130e6116b5b82e6bc7a0 (diff) |
Don't lose a line each time a chunkful of content is read off the disk.
Problem spotted by todd@
Diffstat (limited to 'usr.sbin/smtpd/client.c')
-rw-r--r-- | usr.sbin/smtpd/client.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.sbin/smtpd/client.c b/usr.sbin/smtpd/client.c index a52c3842bf3..48cec277bb6 100644 --- a/usr.sbin/smtpd/client.c +++ b/usr.sbin/smtpd/client.c @@ -1,4 +1,4 @@ -/* $OpenBSD: client.c,v 1.21 2009/12/16 02:20:32 jacekm Exp $ */ +/* $OpenBSD: client.c,v 1.22 2009/12/16 21:40:01 jacekm Exp $ */ /* * Copyright (c) 2009 Jacek Masiulaniec <jacekm@dobremiasto.net> @@ -791,7 +791,7 @@ client_body(struct msgbuf *out, FILE *fp) if ((b = buf_dynamic(0, SIZE_T_MAX)) == NULL) fatal(NULL); - while ((ln = fgetln(fp, &len)) && total < 4096) { + while (total < 4096 && (ln = fgetln(fp, &len))) { if (ln[len - 1] == '\n') len--; if (*ln == '.' && buf_add(b, ".", 1)) |