X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fcode%2Ftarget-format.lisp;h=7ed2b55a1ff25bc46b327280584144e6de797a81;hb=fe6da9f355488152649de48885b96205043c0f82;hp=a5ef5e6eb44cded3f631e9a782ac514db774ed6a;hpb=8f1d4a2508e8d81564822a1668fe30a490b9c3f6;p=sbcl.git diff --git a/src/code/target-format.lisp b/src/code/target-format.lisp index a5ef5e6..7ed2b55 100644 --- a/src/code/target-format.lisp +++ b/src/code/target-format.lisp @@ -170,6 +170,14 @@ ;;;; format interpreters and support functions for simple output (defun format-write-field (stream string mincol colinc minpad padchar padleft) + (when (and colinc (<= colinc 0)) + (error 'format-error + :complaint "The value of colinc is ~a, should be a positive integer" + :args (list colinc))) + (when (and mincol (< mincol 0)) + (error 'format-error + :complaint "The value of mincol is ~a, should be a non-negative integer" + :args (list mincol))) (unless padleft (write-string string stream)) (dotimes (i minpad) @@ -752,9 +760,10 @@ :complaint "cannot specify either colon or atsign for this directive")) (interpret-bind-defaults ((count 1)) params - (fresh-line stream) - (dotimes (i (1- count)) - (terpri stream)))) + (when (plusp count) + (fresh-line stream) + (dotimes (i (1- count)) + (terpri stream))))) (def-format-interpreter #\| (colonp atsignp params) (when (or colonp atsignp)