From 0e2630f8177b07cc52d18277ebf8aae5ef817bb5 Mon Sep 17 00:00:00 2001 From: "nethack.allison" Date: Wed, 19 Feb 2003 06:14:47 +0000 Subject: [PATCH] wizkit fgets() buffer size also ignore lines where we didn't read a newline within BUFSZ characters --- src/files.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/files.c b/src/files.c index 2d33ba7c0..6322edf28 100644 --- a/src/files.c +++ b/src/files.c @@ -2071,9 +2071,9 @@ read_wizkit() if (!wizard || !(fp = fopen_wizkit_file())) return; - while (fgets(buf, 4*BUFSZ, fp)) { + while (fgets(buf, BUFSZ, fp)) { if ((ep = index(buf, '\n'))) *ep = '\0'; - if (buf[0]) { + if (ep && buf[0]) { otmp = readobjnam(buf, (struct obj *)0, FALSE); if (otmp) { if (otmp != &zeroobj) -- 2.40.0