shithub: drawterm-fdroid

Download patch

ref: c0963c9a120840e2cd2a35de1d53d6b365566d91
parent: ffc8608e723c0e5958e90b178cc2e275c7f8a4ab
author: Russ Cox <rsc@swtch.com>
date: Sun Jan 28 11:10:13 EST 2007

respect snarf length

--- a/gui-osx/screen.c
+++ b/gui-osx/screen.c
@@ -629,7 +629,7 @@
 				CFIndex length = CFDataGetLength(cfdata);
 				if (length > sizeof rsnarf) length = sizeof rsnarf;
 				CFDataGetBytes(cfdata, CFRangeMake(0, length), (uint8_t *)rsnarf);
-				snprint(snarf, sizeof snarf, "%S", rsnarf);
+				snprint(snarf, sizeof snarf, "%.*S", length, rsnarf);
 				char *s = snarf;
 				while (*s) {
 					if (*s == '\r') *s = '\n';