From 63c501ea109e648226e0274c3807b7b70dbf3d87 Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Thu, 16 Jun 2022 10:29:56 -0500 Subject: Fix string-length bug --- qotd.scm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/qotd.scm b/qotd.scm index 394085d..da3aba8 100755 --- a/qotd.scm +++ b/qotd.scm @@ -47,7 +47,8 @@ An implementation of the QOTD protocol (RFC 865) #f)) (define (ensure-final-newline str) - (cond ((char=? (string-ref str (- (string-length str) 1)) #\newline) str) + (cond ((not str) "\n") + ((char=? (string-ref str (- (string-length str) 1)) #\newline) str) (else (string-append str "\n")))) (define (main arguments) -- cgit 1.4.1-21-gabe81