Source-Changes-HG archive

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

[src/trunk]: src/sys/compat/linux32/common avoid the shadow



details:   https://anonhg.NetBSD.org/src/rev/06fbff7d9249
branches:  trunk
changeset: 821211:06fbff7d9249
user:      christos <christos%NetBSD.org@localhost>
date:      Sat Jan 28 21:54:57 2017 +0000

description:
avoid the shadow

diffstat:

 sys/compat/linux32/common/linux32_dirent.c |  10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diffs (31 lines):

diff -r ede2e093ecd4 -r 06fbff7d9249 sys/compat/linux32/common/linux32_dirent.c
--- a/sys/compat/linux32/common/linux32_dirent.c        Sat Jan 28 21:47:24 2017 +0000
+++ b/sys/compat/linux32/common/linux32_dirent.c        Sat Jan 28 21:54:57 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: linux32_dirent.c,v 1.16 2017/01/28 15:09:55 christos Exp $ */
+/*     $NetBSD: linux32_dirent.c,v 1.17 2017/01/28 21:54:57 christos Exp $ */
 
 /*-
  * Copyright (c) 2006 Emmanuel Dreyfus, all rights reserved.
@@ -33,7 +33,7 @@
 
 #include <sys/cdefs.h>
 
-__KERNEL_RCSID(0, "$NetBSD: linux32_dirent.c,v 1.16 2017/01/28 15:09:55 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux32_dirent.c,v 1.17 2017/01/28 21:54:57 christos Exp $");
 
 #include <sys/types.h>
 #include <sys/param.h>
@@ -215,9 +215,9 @@
                        idb.d_off = (linux32_off_t)off;
                        idb.d_reclen = (u_short)linux32_reclen;
                }
-               size_t l = MIN(sizeof(idb.d_name) - 1, bdp->d_namlen + 1);
-               memcpy(idb.d_name, bdp->d_name, l);
-               idb.d_name[l + 1] = bdp->d_type;
+               size_t dirl = MIN(sizeof(idb.d_name) - 1, bdp->d_namlen + 1);
+               memcpy(idb.d_name, bdp->d_name, dirl);
+               idb.d_name[dirl + 1] = bdp->d_type;
                if ((error = copyout((void *)&idb, outp, linux32_reclen)))
                        goto out;
                /* advance past this real entry */



Home | Main Index | Thread Index | Old Index