Module Name:    src
Committed By:   pooka
Date:           Fri Apr 30 09:44:38 UTC 2010

Modified Files:
        src/sys/rump/librump/rumpvfs: rumpfs.c

Log Message:
Get better results if initialize a field before calling strlen().
(can't believe that worked last night.  the stars must've been in
the "lottery, stupid" position)


To generate a diff of this commit:
cvs rdiff -u -r1.44 -r1.45 src/sys/rump/librump/rumpvfs/rumpfs.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/rump/librump/rumpvfs/rumpfs.c
diff -u src/sys/rump/librump/rumpvfs/rumpfs.c:1.44 src/sys/rump/librump/rumpvfs/rumpfs.c:1.45
--- src/sys/rump/librump/rumpvfs/rumpfs.c:1.44	Thu Apr 29 22:45:40 2010
+++ src/sys/rump/librump/rumpvfs/rumpfs.c	Fri Apr 30 09:44:38 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: rumpfs.c,v 1.44 2010/04/29 22:45:40 pooka Exp $	*/
+/*	$NetBSD: rumpfs.c,v 1.45 2010/04/30 09:44:38 pooka Exp $	*/
 
 /*
  * Copyright (c) 2009  Antti Kantee.  All Rights Reserved.
@@ -26,7 +26,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: rumpfs.c,v 1.44 2010/04/29 22:45:40 pooka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rumpfs.c,v 1.45 2010/04/30 09:44:38 pooka Exp $");
 
 #include <sys/param.h>
 #include <sys/atomic.h>
@@ -810,8 +810,8 @@
 		struct dirent dent;
 
 		dent.d_fileno = rdent->rd_node->rn_va.va_fileid;
+		strlcpy(dent.d_name, rdent->rd_name, sizeof(dent.d_name));
 		dent.d_namlen = strlen(dent.d_name);
-		strcpy(dent.d_name, rdent->rd_name);
 		dent.d_type = vdmap[rdent->rd_node->rn_va.va_type];
 		dent.d_reclen = _DIRENT_RECLEN(&dent, dent.d_namlen);
 

Reply via email to