From a6ab66d2909535c2a40a1a6e9f2748cd71bfd177 Mon Sep 17 00:00:00 2001 From: Jon Harper Date: Fri, 26 Apr 2013 21:05:39 +0300 Subject: [PATCH] terminfo: interpret shorts as signed integer and test if negative --- extra/terminfo/terminfo.factor | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extra/terminfo/terminfo.factor b/extra/terminfo/terminfo.factor index d90d07a82e..88734b2fd2 100644 --- a/extra/terminfo/terminfo.factor +++ b/extra/terminfo/terminfo.factor @@ -36,7 +36,7 @@ C: terminfo-header boolean-bytes>> read [ 1 = ] { } map-as ; : read-shorts ( n -- seq' ) - 2 * read 2 [ le> dup 65534 >= [ drop f ] when ] map ; + 2 * read 2 [ signed-le> dup 0 < [ drop f ] when ] map ; : align-even-bytes ( header -- ) [ names-bytes>> ] [ boolean-bytes>> ] bi + odd?