about summary refs log tree commit diff stats
path: root/src/HTInit.c
diff options
context:
space:
mode:
authorThomas E. Dickey <dickey@invisible-island.net>1999-04-23 15:06:34 -0400
committerThomas E. Dickey <dickey@invisible-island.net>1999-04-23 15:06:34 -0400
commita735f5ad5123baaa15a0057515f3b242c5d3f372 (patch)
tree58936995ce9e2afd4ba65a735fd44c15509db19a /src/HTInit.c
parentb223937ff728f8242329bedb9c660e81da253e9a (diff)
downloadlynx-snapshots-a735f5ad5123baaa15a0057515f3b242c5d3f372.tar.gz
snapshot of project "lynx", label v2-8-2dev_23
Diffstat (limited to 'src/HTInit.c')
-rw-r--r--src/HTInit.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/src/HTInit.c b/src/HTInit.c
index f6ab32fa..836a3422 100644
--- a/src/HTInit.c
+++ b/src/HTInit.c
@@ -272,16 +272,14 @@ PRIVATE int ProcessMailcapEntry ARGS2(
 	struct MailcapEntry *,	mc)
 {
     size_t rawentryalloc = 2000, len;
-    char *rawentry, *s, *t, *LineBuf;
+    char *rawentry, *s, *t;
+    char *LineBuf = NULL;
 
-    LineBuf = (char *)malloc(LINE_BUF_SIZE);
-    if (!LineBuf)
-	ExitWithError(MEMORY_EXHAUSTED_ABORT);
     rawentry = (char *)malloc(1 + rawentryalloc);
     if (!rawentry)
 	ExitWithError(MEMORY_EXHAUSTED_ABORT);
     *rawentry = '\0';
-    while (fgets(LineBuf, LINE_BUF_SIZE, fp)) {
+    while ((LineBuf = LYSafeGets(LineBuf, fp)) != 0) {
 	if (LineBuf[0] == '#')
 	    continue;
 	len = strlen(LineBuf);
@@ -304,8 +302,6 @@ PRIVATE int ProcessMailcapEntry ARGS2(
 	}
     }
 
-    FREE(LineBuf);
-
     s = LYSkipBlanks(rawentry);
     if (!*s) {
 	/* totally blank entry -- quietly ignore */