From c0963c9a120840e2cd2a35de1d53d6b365566d91 Mon Sep 17 00:00:00 2001 From: Russ Cox Date: Sun, 28 Jan 2007 16:10:13 +0000 Subject: [PATCH] respect snarf length --- gui-osx/screen.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gui-osx/screen.c b/gui-osx/screen.c index 5e5afb0..b38bc05 100644 --- a/gui-osx/screen.c +++ b/gui-osx/screen.c @@ -629,7 +629,7 @@ clipread(void) 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';