shithub: neatroff

Download patch

ref: f53206e184d2bd1d4b234a52b43ac9234880325e
parent: cb78d07d358dd55df2a7a54e03bad3e1ab2b9848
author: Ali Gholami Rudi <ali@rudi.ir>
date: Thu May 7 10:22:04 EDT 2015

cp: long arguments when interpolating strings as \*[xyz args...]

Reported by Dirk-Wilhelm Peters <peters@schwertfisch.de>.

--- a/cp.c
+++ b/cp.c
@@ -26,7 +26,7 @@
 		i += utf8next(d + i, cp_noninext);
 	} else if (!n_cp && c == '[') {
 		c = cp_noninext();
-		while (i < NMLEN - 1 && c >= 0 && c != ']') {
+		while (i < len - 1 && c >= 0 && c != ']') {
 			d[i++] = c;
 			c = cp_noninext();
 		}