Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.sbin/makefs just for safety - use sizeof



details:   https://anonhg.NetBSD.org/src/rev/ebdf28978dc2
branches:  trunk
changeset: 546927:ebdf28978dc2
user:      itojun <itojun%NetBSD.org@localhost>
date:      Fri May 09 00:48:59 2003 +0000

description:
just for safety - use sizeof

diffstat:

 usr.sbin/makefs/walk.c |  6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diffs (27 lines):

diff -r c65d027f8a67 -r ebdf28978dc2 usr.sbin/makefs/walk.c
--- a/usr.sbin/makefs/walk.c    Fri May 09 00:47:46 2003 +0000
+++ b/usr.sbin/makefs/walk.c    Fri May 09 00:48:59 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: walk.c,v 1.12 2003/03/29 00:12:12 thorpej Exp $        */
+/*     $NetBSD: walk.c,v 1.13 2003/05/09 00:48:59 itojun Exp $ */
 
 /*
  * Copyright (c) 2001 Wasabi Systems, Inc.
@@ -77,7 +77,7 @@
 
 #include <sys/cdefs.h>
 #if defined(__RCSID) && !defined(__lint)
-__RCSID("$NetBSD: walk.c,v 1.12 2003/03/29 00:12:12 thorpej Exp $");
+__RCSID("$NetBSD: walk.c,v 1.13 2003/05/09 00:48:59 itojun Exp $");
 #endif /* !__lint */
 
 #include <sys/param.h>
@@ -172,7 +172,7 @@
                        char    slink[PATH_MAX+1];
                        int     llen;
 
-                       llen = readlink(path, slink, PATH_MAX - 1);
+                       llen = readlink(path, slink, sizeof(slink) - 1);
                        if (llen == -1)
                                err(1, "Readlink `%s'", path);
                        slink[llen] = '\0';



Home | Main Index | Thread Index | Old Index