shithub: riscv

Download patch

ref: 2750062701e8dd84b78d8619f164769be7e0a5aa
parent: 9405f4c95f229a173c6f430c12d96ac2c19e8626
author: cinap_lenrek <cinap_lenrek@felloff.net>
date: Sun Mar 2 16:08:48 EST 2014

cc: correct out-of-bounds references in funct.c (thanks charles forsyth)

--- a/sys/src/cmd/cc/funct.c
+++ b/sys/src/cmd/cc/funct.c
@@ -238,7 +238,7 @@
 		goto bad;
 
 	f = alloc(sizeof(*f));
-	for(o=0; o<sizeof(f->sym); o++)
+	for(o=0; o<nelem(f->sym); o++)
 		f->sym[o] = S;
 
 	t->funct = f;