=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/make/Attic/util.c,v retrieving revision 1.18 retrieving revision 1.19 diff -c -r1.18 -r1.19 *** src/usr.bin/make/Attic/util.c 2002/05/29 09:23:25 1.18 --- src/usr.bin/make/Attic/util.c 2003/04/06 22:47:14 1.19 *************** *** 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 $ */ /* --- 1,5 ---- /* $OpenPackages$ */ ! /* $OpenBSD: util.c,v 1.19 2003/04/06 22:47:14 espie Exp $ */ /* $NetBSD: util.c,v 1.10 1996/12/31 17:56:04 christos Exp $ */ /* *************** *** 207,213 **** /* find the inode of root */ if (stat("/", &st_root) == -1) { ! (void)sprintf(pathname, "getwd: Cannot stat \"/\" (%s)", strerror(errno)); return NULL; } --- 207,213 ---- /* find the inode of root */ if (stat("/", &st_root) == -1) { ! (void)snprintf(pathname, MAXPATHLEN, "getwd: Cannot stat \"/\" (%s)", strerror(errno)); return NULL; } *************** *** 218,224 **** /* find the inode of the current directory */ if (lstat(".", &st_cur) == -1) { ! (void)sprintf(pathname, "getwd: Cannot stat \".\" (%s)", strerror(errno)); return NULL; } --- 218,224 ---- /* find the inode of the current directory */ if (lstat(".", &st_cur) == -1) { ! (void)snprintf(pathname, MAXPATHLEN, "getwd: Cannot stat \".\" (%s)", strerror(errno)); return NULL; } *************** *** 230,248 **** /* look if we found root yet */ if (st_cur.st_ino == st_root.st_ino && DEV_DEV_COMPARE(st_cur.st_dev, st_root.st_dev)) { ! (void)strcpy(pathname, *pathptr != '/' ? "/" : pathptr); return pathname; } /* 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; --- 230,248 ---- /* look if we found root yet */ if (st_cur.st_ino == st_root.st_ino && DEV_DEV_COMPARE(st_cur.st_dev, st_root.st_dev)) { ! (void)strlcpy(pathname, *pathptr != '/' ? "/" : pathptr, MAXPATHLEN); return pathname; } /* open the parent directory */ if (stat(nextpathptr, &st_dotdot) == -1) { ! (void)snprintf(pathname, MAXPATHLEN, "getwd: Cannot stat directory \"%s\" (%s)", nextpathptr, strerror(errno)); return NULL; } if ((dp = opendir(nextpathptr)) == NULL) { ! (void)snprintf(pathname, MAXPATHLEN, "getwd: Cannot open directory \"%s\" (%s)", nextpathptr, strerror(errno)); return NULL; *************** *** 265,271 **** 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); --- 265,271 ---- continue; (void)strcpy(cur_name_add, d->d_name); if (lstat(nextpathptr, &st_next) == -1) { ! (void)snprintf(pathname, MAXPATHLEN, "getwd: Cannot stat \"%s\" (%s)", d->d_name, strerror(errno)); (void)closedir(dp); *************** *** 278,284 **** } } if (d == NULL) { ! (void)sprintf(pathname, "getwd: Cannot find \".\" in \"..\""); (void)closedir(dp); return NULL; --- 278,284 ---- } } if (d == NULL) { ! (void)snprintf(pathname, MAXPATHLEN, "getwd: Cannot find \".\" in \"..\""); (void)closedir(dp); return NULL;