From 899d695843e33252da85dcbe136c7cb1e49a85be Mon Sep 17 00:00:00 2001 From: Charles Longeau Date: Fri, 5 Oct 2007 14:39:40 +0000 Subject: check if it's really a newline before removing it with the help of ray@ "Looks OK" millert@ --- usr.bin/mail/fio.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'usr.bin/mail/fio.c') diff --git a/usr.bin/mail/fio.c b/usr.bin/mail/fio.c index dd99ce2c9f1..e621bf953a7 100644 --- a/usr.bin/mail/fio.c +++ b/usr.bin/mail/fio.c @@ -1,4 +1,4 @@ -/* $OpenBSD: fio.c,v 1.29 2007/09/10 14:29:53 tobias Exp $ */ +/* $OpenBSD: fio.c,v 1.30 2007/10/05 14:39:39 chl Exp $ */ /* $NetBSD: fio.c,v 1.8 1997/07/07 22:57:55 phil Exp $ */ /* @@ -34,7 +34,7 @@ #if 0 static const char sccsid[] = "@(#)fio.c 8.2 (Berkeley) 4/20/95"; #else -static const char rcsid[] = "$OpenBSD: fio.c,v 1.29 2007/09/10 14:29:53 tobias Exp $"; +static const char rcsid[] = "$OpenBSD: fio.c,v 1.30 2007/10/05 14:39:39 chl Exp $"; #endif #endif /* not lint */ @@ -132,7 +132,7 @@ setptr(FILE *ibuf, off_t offset) (void)fwrite(linebuf, sizeof(*linebuf), count, otf); if (ferror(otf)) err(1, "/tmp"); - if (count) + if (count && linebuf[count - 1] == '\n') linebuf[count - 1] = '\0'; if (maybe && linebuf[0] == 'F' && ishead(linebuf)) { msgCount++; -- cgit v1.2.3