summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog4
-rw-r--r--src/input.c6
2 files changed, 7 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index a01503a..e7253d1 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2005-10-01  Herbert Xu <herbert@gondor.apana.org.au>
+
+	* Skip NUL characters properly in input.c
+
 2005-03-28  Herbert Xu <herbert@gondor.apana.org.au>
 
 	* Removed some unnecessary inclusions of input.h.
diff --git a/src/input.c b/src/input.c
index 8c874c6..8a43824 100644
--- a/src/input.c
+++ b/src/input.c
@@ -300,9 +300,9 @@ again:
 	something = 0;
 #endif
 	for (more = 1; more;) {
-		switch (*p) {
+		switch (*p++) {
 		case '\0':
-			p++;	/* Skip nul */
+			p = memmove(q, p, parselleft);
 			goto check;
 
 #ifndef SMALL
@@ -323,7 +323,7 @@ again:
 #endif
 		}
 
-		*q++ = *p++;
+		q++;
 check:
 		if (--parselleft <= 0 && more) {
 			parsenleft = q - parsenextc - 1;