Wed Jul 22 15:57:00 2009 UTC ()
Always initialize nread since it is an out param.
From Michael Cook mcook at bbn dot com


(christos)
diff -r1.51 -r1.52 src/lib/libedit/read.c

cvs diff -r1.51 -r1.52 src/lib/libedit/read.c (expand / switch to context diff)
--- src/lib/libedit/read.c 2009/06/09 13:04:33 1.51
+++ src/lib/libedit/read.c 2009/07/22 15:57:00 1.52
@@ -1,4 +1,4 @@
-/*	$NetBSD: read.c,v 1.51 2009/06/09 13:04:33 christos Exp $	*/
+/*	$NetBSD: read.c,v 1.52 2009/07/22 15:57:00 christos Exp $	*/
 
 /*-
  * Copyright (c) 1992, 1993
@@ -37,7 +37,7 @@
 #if 0
 static char sccsid[] = "@(#)read.c	8.1 (Berkeley) 6/4/93";
 #else
-__RCSID("$NetBSD: read.c,v 1.51 2009/06/09 13:04:33 christos Exp $");
+__RCSID("$NetBSD: read.c,v 1.52 2009/07/22 15:57:00 christos Exp $");
 #endif
 #endif /* not lint && not SCCSID */
 
@@ -422,6 +422,7 @@
 
 	if (nread == NULL)
 		nread = &nrb;
+	*nread = 0;
 
 	if (el->el_flags & NO_TTY) {
 		char *cp = el->el_line.buffer;