summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Lowe <richlowe@richlowe.net>2018-02-06 03:48:42 +0000
committerHans Rosenfeld <hans.rosenfeld@joyent.com>2018-04-23 18:15:40 +0200
commit6c7cff64a7c0aafe97d354f169f3230bf9a353c0 (patch)
tree29f59192b5383674c59bf9d5fa2061eae2adb917
parent0ae3c1c128212f440f395f5f1e70577eada7ca85 (diff)
downloadillumos-joyent-6c7cff64a7c0aafe97d354f169f3230bf9a353c0.tar.gz
9416 spell: use fgets not gets
Reviewed by: Andy Stormont <astormont@racktopsystems.com> Reviewed by: Sebastian Wiedenroth <sebastian.wiedenroth@skylime.net> Approved by: Hans Rosenfeld <rosenfeld@grumpf.hope-2000.org>
-rw-r--r--usr/src/cmd/spell/hashmake.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/usr/src/cmd/spell/hashmake.c b/usr/src/cmd/spell/hashmake.c
index 3b7d3f5356..2519f034a5 100644
--- a/usr/src/cmd/spell/hashmake.c
+++ b/usr/src/cmd/spell/hashmake.c
@@ -27,8 +27,6 @@
/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
/* All Rights Reserved */
-#pragma ident "%Z%%M% %I% %E% SMI"
-
#include <stdlib.h>
#include <unistd.h>
#include <stdio.h>
@@ -51,7 +49,7 @@ main(int argc, char **argv)
(void) textdomain(TEXT_DOMAIN);
hashinit();
- while (gets(word)) {
+ while (fgets(word, LINE_MAX, stdin)) {
(void) printf("%.*lo\n", (HASHWIDTH+2)/3, hash(word));
}
return (0);