This is the mail archive of the cygwin-cvs@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[newlib-cygwin] cygwin: console: Use memset to clear an array


https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=7b9bfb4136f23655e243bab89fb62b04bdbacc7f

commit 7b9bfb4136f23655e243bab89fb62b04bdbacc7f
Author: Corinna Vinschen <corinna@vinschen.de>
Date:   Mon Jul 31 11:44:02 2017 +0200

    cygwin: console: Use memset to clear an array
    
    Signed-off-by: Corinna Vinschen <corinna@vinschen.de>

Diff:
---
 winsup/cygwin/fhandler_console.cc | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/winsup/cygwin/fhandler_console.cc b/winsup/cygwin/fhandler_console.cc
index bf4366a..2a978e7 100644
--- a/winsup/cygwin/fhandler_console.cc
+++ b/winsup/cygwin/fhandler_console.cc
@@ -2216,12 +2216,11 @@ fhandler_console::write (const void *vsrc, size_t len)
 	  if (*src == '[')		/* CSI Control Sequence Introducer */
 	    {
 	      con.state = gotsquare;
+	      memset (con.args, 0, sizeof con.args);
+	      con.nargs = 0;
 	      con.saw_question_mark = false;
 	      con.saw_greater_than_sign = false;
 	      con.saw_space = false;
-	      for (con.nargs = 0; con.nargs < MAXARGS; con.nargs++)
-		con.args[con.nargs] = 0;
-	      con.nargs = 0;
 	    }
 	  else if (*src == ']')		/* OSC Operating System Command */
 	    {


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]