code: drawterm

Download patch

ref: 7bdaff72afb4d43d327387ed40e24c83f5381b4c
parent: c0963c9a120840e2cd2a35de1d53d6b365566d91
author: Russ Cox <rsc@swtch.com>
date: Sun Jan 28 19:42:13 EST 2007

fix length

--- a/gui-osx/screen.c
+++ b/gui-osx/screen.c
@@ -626,7 +626,7 @@
 					fprint(2, "apple pasteboard CopyItem failed - Error %d\n", err);
 					return 0;
 				}
-				CFIndex length = CFDataGetLength(cfdata);
+				CFIndex length = CFDataGetLength(cfdata)/sizeof(Rune);
 				if (length > sizeof rsnarf) length = sizeof rsnarf;
 				CFDataGetBytes(cfdata, CFRangeMake(0, length), (uint8_t *)rsnarf);
 				snprint(snarf, sizeof snarf, "%.*S", length, rsnarf);