summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog3
-rw-r--r--module/bsnmp-regex.c12
2 files changed, 9 insertions, 6 deletions
diff --git a/ChangeLog b/ChangeLog
index 63cf085..d65639d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,6 @@
+0.5:
+ * Fix line off by one error.
+
0.4:
* Add regexCounter variable for 64 bit values
* Fix assertion when selecting text at end of line
diff --git a/module/bsnmp-regex.c b/module/bsnmp-regex.c
index d30679b..ffc22c1 100644
--- a/module/bsnmp-regex.c
+++ b/module/bsnmp-regex.c
@@ -484,15 +484,15 @@ io_data (int fd, void *user_data)
for (;;) {
t = strchr (line_buffer, '\n');
if (t == NULL) {
- /* Break really long lines */
- if (len >= LINE_LENGTH - 1)
- t = line_buffer + len;
- else
+ /* Wait for more data */
+ if (len < LINE_LENGTH - 1)
break;
+ /* Break really long lines */
+ n = t = line_buffer + len;
+ } else {
+ n = t + 1;
}
- n = t + 1;
-
/* Break line (also DOS line) */
*t = 0;
if (line_buffer != t && *(t - 1) == '\r')