Index: main/output.lisp
===================================================================
--- main/output.lisp	(revision main,52)
+++ main/output.lisp	(revision main,59)
@@ -60,10 +60,14 @@
 (defun add-clipped-string (window y x s)
   ;; TODO: double check for ob1 in OVER.
-  (multiple-value-bind (maxy maxx) (size window)
-    (unless (<= 0 y maxy) (return-from add-clipped-string))
+  (multiple-value-bind (height width) (size window)
+    (unless (and (<= 0 y (1- height))
+                 (<= x (1- width)))
+      (return-from add-clipped-string))
     (when (< x 0)
+      (when (>= (- x) (length s))
+        (return-from add-clipped-string))
       (setf s (subseq s (- x))
             x 0))
-    (let ((over (- (+ x (length s)) maxx)))
+    (let ((over (- (+ x (length s)) width)))
       (when (> over 0)
         (setf s (subseq s 0 (- (length s) over)))))
