From: Edward Wang Date: Sat, 30 Jul 1983 08:13:57 +0000 (-0800) Subject: malloc space for the filename. X-Git-Tag: BSD-4_2-Snapshot-Development~602 X-Git-Url: https://git.subgeniuskitty.com/unix-history/.git/commitdiff_plain/fd3dcb0b7481f31681c9aceb7d3cc5c5e8ac3281 malloc space for the filename. SCCS-vsn: usr.bin/window/error.c 1.2 --- diff --git a/usr/src/usr.bin/window/error.c b/usr/src/usr.bin/window/error.c index e7b332b5ae..fc43f64d26 100644 --- a/usr/src/usr.bin/window/error.c +++ b/usr/src/usr.bin/window/error.c @@ -1,5 +1,5 @@ #ifndef lint -static char *sccsid = "@(#)error.c 1.1 83/07/28"; +static char *sccsid = "@(#)error.c 1.2 83/07/29"; #endif #include "defs.h" @@ -54,7 +54,10 @@ char *fmt; beginerror(fn) char *fn; { - filename = fn; + char *malloc(); + + filename = malloc(strlen(fn) + 1); + strcpy(filename, fn); } enderror() @@ -65,5 +68,6 @@ enderror() errwin = 0; } baderror = 0; + free(filename); filename = 0; }