shithub: 3d

Download patch

ref: 8e4e30ec8affd697702c22ac2d29d10ac7fe4133
parent: 34bcf237883f8b57201abbb2ec51c1330394f39e
author: qwx <qwx@sciops.net>
date: Sat Mar 6 21:04:31 EST 2021

sys: fix not initializing kproc buffer

--- a/sys.c
+++ b/sys.c
@@ -82,6 +82,7 @@
 	if((fd = open("/dev/kbd", OREAD)) < 0)
 		sysfatal("kproc: %r");
 	memset(buf, 0, sizeof buf);
+	memset(down, 0, sizeof down);
 	for(;;){
 		if(buf[0] != 0){
 			n = strlen(buf)+1;
@@ -119,7 +120,6 @@
 		nbsendul(tmc, 0);
 	}
 }
-
 
 void
 sim(void)