From: Chris Hanson Date: Tue, 16 Jan 1990 01:57:31 +0000 (+0000) Subject: Fix fencepost error in `disk-restore': when allocating space for a C X-Git-Tag: 20090517-FFI~11594 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=46b8d9ce68b4ad8b59c38564e6926d262a307a4b;p=mit-scheme.git Fix fencepost error in `disk-restore': when allocating space for a C string, must allocate one more byte than the string's length to account for trailing \0. --- diff --git a/v7/src/microcode/fasload.c b/v7/src/microcode/fasload.c index 0217d2e4d..2b6c2e7e9 100644 --- a/v7/src/microcode/fasload.c +++ b/v7/src/microcode/fasload.c @@ -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) /* 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)))); diff --git a/v7/src/microcode/version.h b/v7/src/microcode/version.h index b03bc1731..997806ce0 100644 --- a/v7/src/microcode/version.h +++ b/v7/src/microcode/version.h @@ -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 diff --git a/v8/src/microcode/version.h b/v8/src/microcode/version.h index 43fd25eda..50a26f595 100644 --- a/v8/src/microcode/version.h +++ b/v8/src/microcode/version.h @@ -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