Repair 7f44aaf2bf to check argument length before /.

This commit is contained in:
Sam Tobin-Hochstadt 2020-07-09 21:29:49 -04:00
parent 276e3ff7d6
commit 100597f9bb
2 changed files with 2 additions and 1 deletions

View File

@ -1446,6 +1446,7 @@
(err/rt-test (format "apple~"))
(err/rt-test (format "~"))
(err/rt-test (format "~~~"))
(err/rt-test (format "~s") (lambda (e) (regexp-match "requires one")))
(err/rt-test (format "~o") exn:application:mismatch?)
(err/rt-test (format "~o" 1 2) exn:application:mismatch?)
(err/rt-test (format "~c" 1) exn:application:mismatch?)

View File

@ -197,7 +197,7 @@
(define (arguments->string fmt+args)
(define args (cdr fmt+args))
(if (or (null? args) (<= (length args) 50))
(if (<= 1 (length args) 50)
(parameterize ([error-print-width
(max 2 (round (/ (error-print-width) (length args))))])
(apply string-append