about summary refs log tree commit diff stats
path: root/WWW/Library/Implementation/HTNews.c
diff options
context:
space:
mode:
authorThomas E. Dickey <dickey@invisible-island.net>2004-01-08 02:03:09 -0500
committerThomas E. Dickey <dickey@invisible-island.net>2004-01-08 02:03:09 -0500
commit50f9f94bc54ddad1420680e8a8f4c588eeb5d78c (patch)
treee11f7d50456d8f0c1ad03f00424e71b52bd6f505 /WWW/Library/Implementation/HTNews.c
parent6bbc5d0bfc53e1fbe69f916504c008e1b74b0b19 (diff)
downloadlynx-snapshots-50f9f94bc54ddad1420680e8a8f4c588eeb5d78c.tar.gz
snapshot of project "lynx", label v2-8-5dev_17
Diffstat (limited to 'WWW/Library/Implementation/HTNews.c')
-rw-r--r--WWW/Library/Implementation/HTNews.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/WWW/Library/Implementation/HTNews.c b/WWW/Library/Implementation/HTNews.c
index 09b221d5..651e66ad 100644
--- a/WWW/Library/Implementation/HTNews.c
+++ b/WWW/Library/Implementation/HTNews.c
@@ -205,10 +205,13 @@ PRIVATE BOOL initialize NOARGS
 	CTRACE((tfp, "HTNews: NNTPSERVER defined as `%s'\n",
 		    HTNewsHost));
     } else {
-	char server_name[256];
 	FILE* fp = fopen(SERVER_FILE, TXT_R);
 	if (fp) {
-	    if (fscanf(fp, "%s", server_name)==1) {
+	    char server_name[MAXHOSTNAMELEN+1];
+	    if (fgets(server_name, sizeof server_name, fp) != NULL) {
+		char *p = strchr(server_name, '\n');
+		if (p != NULL)
+		    *p = '\0';
 		StrAllocCopy(HTNewsHost, server_name);
 		CTRACE((tfp, "HTNews: File %s defines news host as `%s'\n",
 			    SERVER_FILE, HTNewsHost));