summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStef Walter <stef@memberwebs.com>2005-09-28 15:22:26 +0000
committerStef Walter <stef@memberwebs.com>2005-09-28 15:22:26 +0000
commit131d21a4f9a2758d43344a3446c6812abd58216b (patch)
treeda6dc0b110f7d49128da95f890c90810c7794a83
parentbb8e9da13a516f55008b6a69636640374a92ec6f (diff)
Fixes from Loic Le Loarer <loic.le-loarer@polytechnique.org>
-rw-r--r--AUTHORS1
-rw-r--r--common/usuals.h4
-rw-r--r--src/proxsmtpd.c5
3 files changed, 7 insertions, 3 deletions
diff --git a/AUTHORS b/AUTHORS
index 81e49f5..030c777 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -17,3 +17,4 @@ Laurent Papier <papier@tuxfan.net>
Piotr Klaban <post@klaban.torun.pl>
Greg Hackney <hackney@swbell.net>
Billy B. Bilano <mr.bill.bilano@email.server.unix.bill.bilano.biz>
+Loic Le Loarer <loic.le-loarer@polytechnique.org>
diff --git a/common/usuals.h b/common/usuals.h
index 48d372f..99951d7 100644
--- a/common/usuals.h
+++ b/common/usuals.h
@@ -66,9 +66,9 @@
#ifdef _DEBUG
#include "assert.h"
- #define ASSERT assert
+ #define ASSERT(x) assert(x)
#else
- #define ASSERT
+ #define ASSERT(x)
#endif
#define KL(s) ((sizeof(s) - 1) / sizeof(char))
diff --git a/src/proxsmtpd.c b/src/proxsmtpd.c
index e0d438e..6afc975 100644
--- a/src/proxsmtpd.c
+++ b/src/proxsmtpd.c
@@ -340,18 +340,21 @@ static pid_t fork_filter(spctx_t* sp, int* infd, int* outfd, int* errfd)
{
close(pipe_i[WRITE_END]);
r = dup2(pipe_i[READ_END], STDIN);
+ close(pipe_i[READ_END]);
}
if(r >= 0 && outfd)
{
close(pipe_o[READ_END]);
r = dup2(pipe_o[WRITE_END], STDOUT);
+ close(pipe_o[WRITE_END]);
}
if(r >= 0 && errfd)
{
close(pipe_e[READ_END]);
r = dup2(pipe_e[WRITE_END], STDERR);
+ close(pipe_e[WRITE_END]);
}
if(r < 0)
@@ -830,7 +833,7 @@ static void buffer_reject_message(char* data, char* buf, int buflen)
* Basically if we already have a newline at the end
* then we need to start a new line
*/
- if(buf[strlen(buf)] == '\n')
+ if(buf[strlen(buf) - 1] == '\n')
buf[0] = 0;
}
else