Apurdue.152
net.bugs.4bsd
utcsrgv!utzoo!decvax!pur-ee!purdue!cak
Fri Jan 15 12:20:39 1982
savecore.c revisited
Ooops, I goofed. In the recently published fix to savecore.c, I forgot
something. It's not good enough to just extend the array size. Here's
the diff that makes the difference:
*** /usr/src/cmd/savecore.c Fri Jan 15 11:43:47 1982
--- /usr/src/cmd/savecore.c.v0 Thu Jan 14 16:40:51 1982
***************
*** 87,93
register int dfd = Open("/dev", 0);
struct direct dir;
struct stat statb;
! static char devname[DIRSIZ + 6];
char *dp;
strcpy(devname, "/dev/");
--- 87,93 -----
register int dfd = Open("/dev", 0);
struct direct dir;
struct stat statb;
! static char devname[DIRSIZ + 1];
char *dp;
strcpy(devname, "/dev/");
***************
*** 95,101
if (dir.d_ino == 0)
continue;
strncpy(devname + 5, dir.d_name, DIRSIZ);
! devname[DIRSIZ + 6] = '\0';
if (stat(devname, &statb)) {
perror(devname);
continue;
--- 95,101 -----
if (dir.d_ino == 0)
continue;
strncpy(devname + 5, dir.d_name, DIRSIZ);
! devname[DIRSIZ] = '\0';
if (stat(devname, &statb)) {
perror(devname);
continue;
Oh the humiliation of incomplete testing!
chris
-----------------------------------------------------------------
gopher://quux.org/ conversion by John Goerzen <
[email protected]>
of
http://communication.ucsd.edu/A-News/
This Usenet Oldnews Archive
article may be copied and distributed freely, provided:
1. There is no money collected for the text(s) of the articles.
2. The following notice remains appended to each copy:
The Usenet Oldnews Archive: Compilation Copyright (C) 1981, 1996
Bruce Jones, Henry Spencer, David Wiseman.