=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/make/Attic/util.c,v retrieving revision 1.17 retrieving revision 1.18 diff -c -r1.17 -r1.18 *** src/usr.bin/make/Attic/util.c 2002/02/19 19:39:38 1.17 --- src/usr.bin/make/Attic/util.c 2002/05/29 09:23:25 1.18 *************** *** 1,5 **** /* $OpenPackages$ */ ! /* $OpenBSD: util.c,v 1.17 2002/02/19 19:39:38 millert Exp $ */ /* $NetBSD: util.c,v 1.10 1996/12/31 17:56:04 christos Exp $ */ /* --- 1,5 ---- /* $OpenPackages$ */ ! /* $OpenBSD: util.c,v 1.18 2002/05/29 09:23:25 deraadt Exp $ */ /* $NetBSD: util.c,v 1.10 1996/12/31 17:56:04 christos Exp $ */ /* *************** *** 46,52 **** { static char buf[100]; if (e < 0 || e >= sys_nerr) { ! sprintf(buf, "Unknown error %d", e); return buf; } else --- 46,52 ---- { static char buf[100]; if (e < 0 || e >= sys_nerr) { ! snprintf(buf, sizeof buf, "Unknown error %d", e); return buf; } else *************** *** 208,214 **** /* find the inode of root */ if (stat("/", &st_root) == -1) { (void)sprintf(pathname, ! "getwd: Cannot stat \"/\" (%s)", strerror(errno)); return NULL; } pathbuf[MAXPATHLEN - 1] = '\0'; --- 208,214 ---- /* find the inode of root */ if (stat("/", &st_root) == -1) { (void)sprintf(pathname, ! "getwd: Cannot stat \"/\" (%s)", strerror(errno)); return NULL; } pathbuf[MAXPATHLEN - 1] = '\0'; *************** *** 219,225 **** /* find the inode of the current directory */ if (lstat(".", &st_cur) == -1) { (void)sprintf(pathname, ! "getwd: Cannot stat \".\" (%s)", strerror(errno)); return NULL; } nextpathptr = strrcpy(nextpathptr, "../"); --- 219,225 ---- /* find the inode of the current directory */ if (lstat(".", &st_cur) == -1) { (void)sprintf(pathname, ! "getwd: Cannot stat \".\" (%s)", strerror(errno)); return NULL; } nextpathptr = strrcpy(nextpathptr, "../"); *************** *** 237,250 **** /* open the parent directory */ if (stat(nextpathptr, &st_dotdot) == -1) { (void)sprintf(pathname, ! "getwd: Cannot stat directory \"%s\" (%s)", ! nextpathptr, strerror(errno)); return NULL; } if ((dp = opendir(nextpathptr)) == NULL) { (void)sprintf(pathname, ! "getwd: Cannot open directory \"%s\" (%s)", ! nextpathptr, strerror(errno)); return NULL; } --- 237,250 ---- /* open the parent directory */ if (stat(nextpathptr, &st_dotdot) == -1) { (void)sprintf(pathname, ! "getwd: Cannot stat directory \"%s\" (%s)", ! nextpathptr, strerror(errno)); return NULL; } if ((dp = opendir(nextpathptr)) == NULL) { (void)sprintf(pathname, ! "getwd: Cannot open directory \"%s\" (%s)", ! nextpathptr, strerror(errno)); return NULL; } *************** *** 265,272 **** continue; (void)strcpy(cur_name_add, d->d_name); if (lstat(nextpathptr, &st_next) == -1) { ! (void)sprintf(pathname, "getwd: Cannot stat \"%s\" (%s)", ! d->d_name, strerror(errno)); (void)closedir(dp); return NULL; } --- 265,273 ---- continue; (void)strcpy(cur_name_add, d->d_name); if (lstat(nextpathptr, &st_next) == -1) { ! (void)sprintf(pathname, ! "getwd: Cannot stat \"%s\" (%s)", ! d->d_name, strerror(errno)); (void)closedir(dp); return NULL; } *************** *** 277,283 **** } } if (d == NULL) { ! (void)sprintf(pathname, "getwd: Cannot find \".\" in \"..\""); (void)closedir(dp); return NULL; } --- 278,285 ---- } } if (d == NULL) { ! (void)sprintf(pathname, ! "getwd: Cannot find \".\" in \"..\""); (void)closedir(dp); return NULL; }