summary refs log tree commit diff
path: root/misc/getusershell.c
diff options
context:
space:
mode:
Diffstat (limited to 'misc/getusershell.c')
-rw-r--r--misc/getusershell.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/misc/getusershell.c b/misc/getusershell.c
index 6b210b68ff..d822f554ea 100644
--- a/misc/getusershell.c
+++ b/misc/getusershell.c
@@ -96,6 +96,7 @@ initshells()
 	register char **sp, *cp;
 	register FILE *fp;
 	struct stat statb;
+	int flen;
 
 	if (shells != NULL)
 		free(shells);
@@ -122,7 +123,8 @@ initshells()
 	}
 	sp = shells;
 	cp = strings;
-	while (fgets(cp, statb.st_size - (cp - strings), fp) != NULL) {
+	flen = statb.st_size;
+	while (fgets_unlocked(cp, flen - (cp - strings), fp) != NULL) {
 		while (*cp != '#' && *cp != '/' && *cp != '\0')
 			cp++;
 		if (*cp == '#' || *cp == '\0')