Fix fencepost error in `disk-restore': when allocating space for a C
authorChris Hanson <org/chris-hanson/cph>
Tue, 16 Jan 1990 01:57:31 +0000 (01:57 +0000)
committerChris Hanson <org/chris-hanson/cph>
Tue, 16 Jan 1990 01:57:31 +0000 (01:57 +0000)
string, must allocate one more byte than the string's length to
account for trailing \0.

v7/src/microcode/fasload.c
v7/src/microcode/version.h
v8/src/microcode/version.h

index 0217d2e4d05074f8cb1ecacaa3c55a0ea44c906a..2b6c2e7e9cd43f56c59d01681de6ef9d5473e97d 100644 (file)
@@ -1,6 +1,6 @@
 /* -*-C-*-
 
-$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/fasload.c,v 9.46 1989/11/26 17:38:44 jinx Exp $
+$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/fasload.c,v 9.47 1990/01/16 01:57:07 cph Exp $
 
 Copyright (c) 1987, 1988, 1989 Massachusetts Institute of Technology
 
@@ -771,7 +771,7 @@ DEFINE_PRIMITIVE ("LOAD-BAND", Prim_band_load, 1, 1, 0)
 \f
   /* Point of no return. */
 
-  length = (STRING_LENGTH (argument));
+  length = ((STRING_LENGTH (argument)) + 1); /* add 1 for \0 at end */
   band_name = malloc(length);
   if (band_name != ((char *) NULL))
     strcpy (band_name, ((char *) (STRING_LOC (argument, 0))));
index b03bc1731b14c33a88f50de6b593a9596d9e733f..997806ce0a566f6b5fd7bb763adde9855f072305 100644 (file)
@@ -1,6 +1,6 @@
 /* -*-C-*-
 
-$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/Attic/version.h,v 11.18 1990/01/12 23:37:17 cph Exp $
+$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/Attic/version.h,v 11.19 1990/01/16 01:57:31 cph Exp $
 
 Copyright (c) 1988, 1989, 1990 Massachusetts Institute of Technology
 
@@ -46,7 +46,7 @@ MIT in each case. */
 #define VERSION                11
 #endif
 #ifndef SUBVERSION
-#define SUBVERSION     18
+#define SUBVERSION     19
 #endif
 
 #ifndef UCODE_TABLES_FILENAME
index 43fd25edac49eec0b65fbc7feab200edb3ed0639..50a26f595e1b2171dc15712dbe92245ab1e09d72 100644 (file)
@@ -1,6 +1,6 @@
 /* -*-C-*-
 
-$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v8/src/microcode/version.h,v 11.18 1990/01/12 23:37:17 cph Exp $
+$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v8/src/microcode/version.h,v 11.19 1990/01/16 01:57:31 cph Exp $
 
 Copyright (c) 1988, 1989, 1990 Massachusetts Institute of Technology
 
@@ -46,7 +46,7 @@ MIT in each case. */
 #define VERSION                11
 #endif
 #ifndef SUBVERSION
-#define SUBVERSION     18
+#define SUBVERSION     19
 #endif
 
 #ifndef UCODE_TABLES_FILENAME