shithub: neatroff

Download patch

ref: 293bea16104281fe65719b462177dc29dd092db0
parent: 48ab6e8a220310ddac3942a5605040e761f0c2ae
author: Ali Gholami Rudi <[email protected]>
date: Fri Sep 26 06:19:59 EDT 2014

in: increase the size of unread characters buffer

--- a/in.c
+++ b/in.c
@@ -9,7 +9,7 @@
 	FILE *fin;
 	char *buf;		/* for string buffers */
 	char **args;
-	int unbuf[8];		/* unread characters */
+	int unbuf[32];		/* unread characters */
 	int un;			/* number of unread characters */
 	int pos;
 	int len;
@@ -127,7 +127,7 @@
 {
 	if (c < 0)
 		return;
-	if (buf)
+	if (buf && buf->un < sizeof(buf->unbuf))
 		buf->unbuf[buf->un++] = c;
 }