[hackers] [quark] No need for MAXBUFLEN+1 || sin
commit 5d20e3dc27b27af3f5d582c87ba82c30a9163e98
Author: sin <sin_AT_2f30.org>
Date: Wed Aug 13 23:20:20 2014 +0100
No need for MAXBUFLEN+1
Return -1 if writedata() fails.
diff --git a/quark.c b/quark.c
index f5a74a3..9a2fd1f 100644
--- a/quark.c
+++ b/quark.c
_AT_@ -91,8 +91,8 @@ static char location[256];
static int running = 1;
static int status;
static char host[NI_MAXHOST];
-static char reqbuf[MAXBUFLEN+1];
-static char resbuf[MAXBUFLEN+1];
+static char reqbuf[MAXBUFLEN];
+static char resbuf[MAXBUFLEN];
static char reqhost[256];
static char reqmod[256];
static int fd = -1;
_AT_@ -115,7 +115,7 @@ writedata(const char *buf, size_t buf_len) {
for (offset = 0; offset < buf_len; offset += r) {
if ((r = write(req.fd, buf + offset, buf_len - offset)) == -1) {
logerrmsg("client %s closed connection
", host);
- return 1;
+ return -1;
}
}
return 0;
Received on Thu Aug 14 2014 - 09:54:34 CEST
This archive was generated by hypermail 2.3.0
: Thu Aug 14 2014 - 10:00:14 CEST