From 075a8494bdea31342a1e20b29917dc280d489da9 Mon Sep 17 00:00:00 2001 From: Bob Halley Date: Wed, 28 Apr 1999 00:30:23 +0000 Subject: [PATCH] convert to fgets --- bin/tests/sym_test.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/bin/tests/sym_test.c b/bin/tests/sym_test.c index 5c618dfe2b..ec32038353 100644 --- a/bin/tests/sym_test.c +++ b/bin/tests/sym_test.c @@ -69,8 +69,12 @@ main(int argc, char *argv[]) { RUNTIME_CHECK(isc_symtab_create(mctx, 691, undefine_action, case_sensitive, &st) == ISC_R_SUCCESS); - while (gets(s) != NULL) { + while (fgets(s, sizeof s, stdin) != NULL) { len = strlen(s); + if (len > 0 && s[len - 1] == '\n') { + s[len - 1] = '\0'; + len--; + } cp = s;