summaryrefslogtreecommitdiffstats
path: root/mbbsd/record.c
diff options
context:
space:
mode:
authorscw <scw@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2004-09-19 13:35:10 +0800
committerscw <scw@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2004-09-19 13:35:10 +0800
commit93bea2179b62913dcf32ebeacbde715b3a03f2f9 (patch)
tree7735963a5ba5a5409317da3ca26c84bc4cc2008a /mbbsd/record.c
parent14cbdd79c0fbd18327c45a32ac40adf2548d38a3 (diff)
downloadpttbbs-93bea2179b62913dcf32ebeacbde715b3a03f2f9.tar
pttbbs-93bea2179b62913dcf32ebeacbde715b3a03f2f9.tar.gz
pttbbs-93bea2179b62913dcf32ebeacbde715b3a03f2f9.tar.bz2
pttbbs-93bea2179b62913dcf32ebeacbde715b3a03f2f9.tar.lz
pttbbs-93bea2179b62913dcf32ebeacbde715b3a03f2f9.tar.xz
pttbbs-93bea2179b62913dcf32ebeacbde715b3a03f2f9.tar.zst
pttbbs-93bea2179b62913dcf32ebeacbde715b3a03f2f9.zip
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
Diffstat (limited to 'mbbsd/record.c')
-rw-r--r--mbbsd/record.c6
1 files 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) {