diff options
-rw-r--r-- | ChangeLog | 1 | ||||
-rw-r--r-- | configure.in | 4 | ||||
-rw-r--r-- | module/bsnmp-regex.c | 13 |
3 files changed, 10 insertions, 8 deletions
@@ -1,4 +1,5 @@ 0.2: + * Fix bug with an assert on long lines * Better configure.in checks. * Cleanup the MIB a bit diff --git a/configure.in b/configure.in index 2f63558..adf55f4 100644 --- a/configure.in +++ b/configure.in @@ -1,6 +1,6 @@ # Process this file with autoconf to produce a configure script. -AC_INIT(bsnmp-regex, 0.1, nielsen@memberwebs.com) -AM_INIT_AUTOMAKE(bsnmp-regex, 0.1) +AC_INIT(bsnmp-regex, 0.1.90, nielsen@memberwebs.com) +AM_INIT_AUTOMAKE(bsnmp-regex, 0.1.90) AC_CONFIG_SRCDIR([module/bsnmp-regex.c]) AM_CONFIG_HEADER([config.h]) diff --git a/module/bsnmp-regex.c b/module/bsnmp-regex.c index cfa8163..a859264 100644 --- a/module/bsnmp-regex.c +++ b/module/bsnmp-regex.c @@ -450,7 +450,7 @@ io_data (int fd, void *user_data) { struct connection *conn = (struct connection*)user_data; char *line_buffer; - char *t; + char *t, *n; int len; int r, l; @@ -491,19 +491,20 @@ io_data (int fd, void *user_data) break; } + n = t; + /* Break line (also DOS line) */ *t = 0; if (line_buffer != t && *(t - 1) == '\r') - *(t - 1) = 0; - l = (t + 1) - line_buffer; + *(--t) = 0; + l = t - line_buffer; /* Send it off */ process_log (line_buffer, l); /* Move data to front of buffer */ - ASSERT (l <= len); - memmove (line_buffer, t + 1, (len - l) + 1); - len -= l; + len -= (n - line_buffer); + memmove (line_buffer, n, len); } } while (r > 0); |