summaryrefslogtreecommitdiff
path: root/sbin/restore/dirs.c
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>1998-06-23 22:40:56 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>1998-06-23 22:40:56 +0000
commit30cb72a00b8cc59895c391cad0f8e31611611ec4 (patch)
tree3e2f67dd80af3489363cf0596b740c6533994e40 /sbin/restore/dirs.c
parent325437057bbda9490b174c8fc6dc8f0e14a8f145 (diff)
Fix snprintf return value usage.
Diffstat (limited to 'sbin/restore/dirs.c')
-rw-r--r--sbin/restore/dirs.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/sbin/restore/dirs.c b/sbin/restore/dirs.c
index 7f6eec0ac6c..2218bfcf084 100644
--- a/sbin/restore/dirs.c
+++ b/sbin/restore/dirs.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: dirs.c,v 1.15 1998/02/17 00:07:51 millert Exp $ */
+/* $OpenBSD: dirs.c,v 1.16 1998/06/23 22:40:30 millert Exp $ */
/* $NetBSD: dirs.c,v 1.26 1997/07/01 05:37:49 lukem Exp $ */
/*
@@ -43,7 +43,7 @@
#if 0
static char sccsid[] = "@(#)dirs.c 8.5 (Berkeley) 8/31/94";
#else
-static char rcsid[] = "$OpenBSD: dirs.c,v 1.15 1998/02/17 00:07:51 millert Exp $";
+static char rcsid[] = "$OpenBSD: dirs.c,v 1.16 1998/06/23 22:40:30 millert Exp $";
#endif
#endif /* not lint */
@@ -257,6 +257,8 @@ treescan(pname, ino, todo)
* skipping over "." and ".."
*/
namelen = snprintf(locname, sizeof(locname), "%s/", pname);
+ if (namelen >= sizeof(locname))
+ namelen = sizeof(locname) - 1;
rst_seekdir(dirp, itp->t_seekpt, itp->t_seekpt);
dp = rst_readdir(dirp); /* "." */
if (dp != NULL && strcmp(dp->d_name, ".") == 0)