From 93bea2179b62913dcf32ebeacbde715b3a03f2f9 Mon Sep 17 00:00:00 2001
From: scw <scw@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>
Date: Sun, 19 Sep 2004 05:35:10 +0000
Subject: Fix wrong testing of return value of read in apply_record(). Effected
 sequential_read() and m_new().

git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@2202 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
---
 mbbsd/record.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/mbbsd/record.c b/mbbsd/record.c
index f5d5929c..616c8425 100644
--- a/mbbsd/record.c
+++ b/mbbsd/record.c
@@ -425,11 +425,13 @@ safe_article_delete_range(char *direct, int from, int to)
 
 #endif		
 
-int             apply_record(char *fpath, int (*fptr) (), int size){
+int
+apply_record(char *fpath, int (*fptr) (), int size){
     char            abuf[BUFSIZE];
     int           fp;
 
-    if((fp=open(fpath, O_RDONLY, 0))) return -1;
+    if((fp=open(fpath, O_RDONLY, 0)) == -1)
+	return -1;
 
     while (read(fp, abuf, size) == (size_t)size)
 	if ((*fptr) (abuf) == QUIT) {
-- 
cgit v1.2.3