=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/stat/stat.c,v retrieving revision 1.9 retrieving revision 1.10 diff -c -r1.9 -r1.10 *** src/usr.bin/stat/stat.c 2005/04/11 08:19:07 1.9 --- src/usr.bin/stat/stat.c 2005/04/22 09:58:43 1.10 *************** *** 1,4 **** ! /* $OpenBSD: stat.c,v 1.9 2005/04/11 08:19:07 otto Exp $ */ /* $NetBSD: stat.c,v 1.19 2004/06/20 22:20:16 jmc Exp $ */ /* --- 1,4 ---- ! /* $OpenBSD: stat.c,v 1.10 2005/04/22 09:58:43 otto Exp $ */ /* $NetBSD: stat.c,v 1.19 2004/06/20 22:20:16 jmc Exp $ */ /* *************** *** 39,45 **** #ifndef lint static const char rccs_id[] = ! "$OpenBSD: stat.c,v 1.9 2005/04/11 08:19:07 otto Exp $"; #endif #include --- 39,45 ---- #ifndef lint static const char rccs_id[] = ! "$OpenBSD: stat.c,v 1.10 2005/04/22 09:58:43 otto Exp $"; #endif #include *************** *** 308,314 **** const char *statfmt, int fn, int nonl) { int flags, size, prec, ofmt, hilo, what; ! char buf[PATH_MAX]; const char *subfmt; int nl, t, i; --- 308,314 ---- const char *statfmt, int fn, int nonl) { int flags, size, prec, ofmt, hilo, what; ! char buf[PATH_MAX + 4 + 1]; const char *subfmt; int nl, t, i; *************** *** 474,480 **** t = format1(st, file, subfmt, statfmt - subfmt, buf, sizeof(buf), flags, size, prec, ofmt, hilo, what); ! for (i = 0; i < t && i < sizeof(buf); i++) addchar(stdout, buf[i], &nl); continue; --- 474,480 ---- t = format1(st, file, subfmt, statfmt - subfmt, buf, sizeof(buf), flags, size, prec, ofmt, hilo, what); ! for (i = 0; i < t && i < sizeof(buf) - 1; i++) addchar(stdout, buf[i], &nl); continue;