summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>1999-12-05 02:37:56 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>1999-12-05 02:37:56 +0000
commitef65bb2eb02373c56b6b70c777c0604d3d4f1890 (patch)
treedf64bca11bd75f6a4b67e924253626177aaa284d
parente336096fbf44dafb86860649c01503cb1b33162b (diff)
not MAXPATHLEN+1
-rw-r--r--bin/ed/main.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/bin/ed/main.c b/bin/ed/main.c
index 0be9a35f5b9..1e4fdc5ebb1 100644
--- a/bin/ed/main.c
+++ b/bin/ed/main.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: main.c,v 1.15 1999/12/04 23:45:36 provos Exp $ */
+/* $OpenBSD: main.c,v 1.16 1999/12/05 02:37:55 deraadt Exp $ */
/* $NetBSD: main.c,v 1.3 1995/03/21 09:04:44 cgd Exp $ */
/* main.c: This file contains the main control and user-interface routines
@@ -39,7 +39,7 @@ char *copyright =
#if 0
static char *rcsid = "@(#)main.c,v 1.1 1994/02/01 00:34:42 alm Exp";
#else
-static char rcsid[] = "$OpenBSD: main.c,v 1.15 1999/12/04 23:45:36 provos Exp $";
+static char rcsid[] = "$OpenBSD: main.c,v 1.16 1999/12/05 02:37:55 deraadt Exp $";
#endif
#endif /* not lint */
@@ -1374,12 +1374,12 @@ strip_escapes(s)
int i = 0;
- REALLOC(file, filesz, MAXPATHLEN + 1, NULL);
+ REALLOC(file, filesz, MAXPATHLEN, NULL);
/* assert: no trailing escape */
while ((file[i++] = (*s == '\\') ? *++s : *s) != '\0' &&
- i < MAXPATHLEN)
+ i < MAXPATHLEN-1)
s++;
- file[MAXPATHLEN] = '\0';
+ file[MAXPATHLEN-1] = '\0';
return file;
}