shithub: gefs

Download patch

ref: af37a8efb7c758e96c08ad684638087f8d1b6482
parent: 9344873513e6bdde31746cd332aa9a9d954157d9
author: Michael Forney <mforney@mforney.org>
date: Sat Feb 12 20:40:16 EST 2022

user: fix one more index reuse during parseusers

--- a/user.c
+++ b/user.c
@@ -212,9 +212,9 @@
 			if(m[0] == '\0')
 				continue;
 			u = nil;
-			for(i = 0; i < nusers; i++)
-				if(strcmp(users[i].name, m) == 0)
-					u = &users[i];
+			for(j = 0; j < nusers; j++)
+				if(strcmp(users[j].name, m) == 0)
+					u = &users[j];
 			if(u == nil){
 				fprint(fd, "/adm/users:%d: user %s does not exist\n", lnum, m);
 				err = Enouser;