Make sure that the line buffer in readfd_unbuffered() is large
authorWayne Davison <wayned@samba.org>
Mon, 4 Apr 2005 17:27:56 +0000 (17:27 +0000)
committerWayne Davison <wayned@samba.org>
Mon, 4 Apr 2005 17:27:56 +0000 (17:27 +0000)
enough to handle long-filename messages on a system that has a
really short MAXPATHLEN value.  Also, make it large enough to
be able to comment on a MAXPATHLEN filename.

io.c

diff --git a/io.c b/io.c
index 42a6bf0c87ee163152592b5e6751737013457dd8..bdfebafc45f0275df24334033423d17e360d805b 100644 (file)
--- a/io.c
+++ b/io.c
@@ -706,7 +706,11 @@ static int readfd_unbuffered(int fd, char *buf, size_t len)
        static size_t remaining;
        static size_t iobuf_in_ndx;
        int tag, ret = 0;
-       char line[MAXPATHLEN+1];
+#if MAXPATHLEN < 4096
+       char line[4096+1024];
+#else
+       char line[MAXPATHLEN+1024];
+#endif
 
        if (!iobuf_in || fd != sock_f_in)
                return read_timeout(fd, buf, len);