]> granicus.if.org Git - nethack/commitdiff
wizkit fgets() buffer size
authornethack.allison <nethack.allison>
Wed, 19 Feb 2003 06:14:47 +0000 (06:14 +0000)
committernethack.allison <nethack.allison>
Wed, 19 Feb 2003 06:14:47 +0000 (06:14 +0000)
also ignore lines where we didn't read a newline within BUFSZ characters

src/files.c

index 2d33ba7c009c84206592066c3dcfd2a0021533d8..6322edf288e3e13ca782430df021fa003ad04e14 100644 (file)
@@ -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)