summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjacekm <jacekm@openbsd.org>2009-07-19 19:06:02 +0000
committerjacekm <jacekm@openbsd.org>2009-07-19 19:06:02 +0000
commitfd0b2f43bb30cc5a30c8b5750fc166c6acaafab2 (patch)
treec4e87719d402aac5d3b127d2a13fa53c6b29aae4
parentSimplify code that sanitizes pci resources on the O2's mace PCI bridge. (diff)
downloadwireguard-openbsd-fd0b2f43bb30cc5a30c8b5750fc166c6acaafab2.tar.xz
wireguard-openbsd-fd0b2f43bb30cc5a30c8b5750fc166c6acaafab2.zip
fix fwrite return code checking.
bug exposed by recent change to fwrite, and reported by oga. ok gilles
-rw-r--r--usr.sbin/smtpd/smtp_session.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.sbin/smtpd/smtp_session.c b/usr.sbin/smtpd/smtp_session.c
index ea47532147d..5e9bc692840 100644
--- a/usr.sbin/smtpd/smtp_session.c
+++ b/usr.sbin/smtpd/smtp_session.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: smtp_session.c,v 1.107 2009/06/06 04:14:21 pyr Exp $ */
+/* $OpenBSD: smtp_session.c,v 1.108 2009/07/19 19:06:02 jacekm Exp $ */
/*
* Copyright (c) 2008 Gilles Chehade <gilles@openbsd.org>
@@ -841,7 +841,7 @@ session_read_data(struct session *s, char *line, size_t nread)
len = strlen(line);
- if (fwrite(line, len, 1, s->datafp) != 1 ||
+ if (fwrite(line, 1, len, s->datafp) != len ||
fwrite("\n", 1, 1, s->datafp) != 1) {
s->s_msg.status |= S_MESSAGE_TEMPFAILURE;
return;