Fix fencepost error in code that places zero byte at end of string.
authorChris Hanson <org/chris-hanson/cph>
Wed, 20 Jan 1993 10:35:53 +0000 (10:35 +0000)
committerChris Hanson <org/chris-hanson/cph>
Wed, 20 Jan 1993 10:35:53 +0000 (10:35 +0000)
v7/src/edwin/utils.scm

index 214bb1fac8045579da562c53403b3df594d69337..be188488a9191cba933765b912b10a59630b993b 100644 (file)
@@ -1,6 +1,6 @@
 ;;; -*-Scheme-*-
 ;;;
-;;;    $Id: utils.scm,v 1.30 1993/01/20 10:06:09 cph Exp $
+;;;    $Id: utils.scm,v 1.31 1993/01/20 10:35:53 cph Exp $
 ;;;
 ;;;    Copyright (c) 1986, 1989-93 Massachusetts Institute of Technology
 ;;;
          (fix:- n-words 1)))
        (set-string-length! result n-chars)
        ;; This won't work if range-checking is turned on.
-       (string-set! result (fix:+ n-chars 1) #\nul)
+       (string-set! result n-chars #\nul)
        ((ucode-primitive primitive-increment-free 1) n-words)
        (set-interrupt-enables! mask)
        result))))
       (fix:+ (fix:lsh n-chars (chars-to-words-shift)) 2)))
     (set-string-length! string n-chars)
     ;; This won't work if range-checking is turned on.
-    (string-set! string (fix:+ n-chars 1) #\nul)
+    (string-set! string n-chars #\nul)
     (set-interrupt-enables! mask)
     unspecific))
 \f