summaryrefslogtreecommitdiffstats
path: root/mbbsd
diff options
context:
space:
mode:
authorkcwu <kcwu@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2005-09-09 17:18:44 +0800
committerkcwu <kcwu@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2005-09-09 17:18:44 +0800
commit83191c06b40c522464f7021cb25cc2367375f1ce (patch)
treeedf64932f25bda8a409a217c1a4487d9af7ed47e /mbbsd
parentbb00ae154f1cfc4672aa807926c19b0b5e64d8ea (diff)
downloadpttbbs-83191c06b40c522464f7021cb25cc2367375f1ce.tar
pttbbs-83191c06b40c522464f7021cb25cc2367375f1ce.tar.gz
pttbbs-83191c06b40c522464f7021cb25cc2367375f1ce.tar.bz2
pttbbs-83191c06b40c522464f7021cb25cc2367375f1ce.tar.lz
pttbbs-83191c06b40c522464f7021cb25cc2367375f1ce.tar.xz
pttbbs-83191c06b40c522464f7021cb25cc2367375f1ce.tar.zst
pttbbs-83191c06b40c522464f7021cb25cc2367375f1ce.zip
comments warn the bad code without error handling.
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@3145 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'mbbsd')
-rw-r--r--mbbsd/announce.c2
-rw-r--r--mbbsd/read.c3
-rw-r--r--mbbsd/record.c1
3 files changed, 5 insertions, 1 deletions
diff --git a/mbbsd/announce.c b/mbbsd/announce.c
index 99ff6585..632792d4 100644
--- a/mbbsd/announce.c
+++ b/mbbsd/announce.c
@@ -173,7 +173,7 @@ a_loadname(menu_t * pm)
}
setadir(buf, pm->path);
- len = get_records(buf, pm->header, FHSZ, pm->page + 1, pm->header_size);
+ len = get_records(buf, pm->header, FHSZ, pm->page + 1, pm->header_size); // XXX if get_records() return -1
if (len < pm->header_size)
bzero(&pm->header[len], FHSZ * (pm->header_size - len));
}
diff --git a/mbbsd/read.c b/mbbsd/read.c
index 14cf4e8c..d9900cbb 100644
--- a/mbbsd/read.c
+++ b/mbbsd/read.c
@@ -928,6 +928,7 @@ get_records_and_bottom(char *direct, fileheader_t* headers,
rv = get_records(direct, headers, sizeof(fileheader_t), recbase, n);
+ /* XXX if entries return -1 */
if( bottom_line < last_line )
rv += get_records(directbottom, headers+n, sizeof(fileheader_t), 1,
headers_size - n );
@@ -1020,6 +1021,7 @@ i_read(int cmdmode, const char *direct, void (*dotitle) (),
headers = (fileheader_t *) realloc(headers, headers_size*FHSZ);
assert(headers);
}
+ /* XXX if entries return -1 */
entries=get_records_and_bottom(currdirect,
headers, recbase, headers_size, last_line, bottom_line);
}
@@ -1061,6 +1063,7 @@ i_read(int cmdmode, const char *direct, void (*dotitle) (),
headers = (fileheader_t *) realloc(headers, headers_size*FHSZ);
assert(headers);
}
+ /* XXX if entries return -1 */
entries =
get_records_and_bottom(currdirect, headers, recbase,
headers_size, last_line, bottom_line);
diff --git a/mbbsd/record.c b/mbbsd/record.c
index 0a4e9255..e8b56500 100644
--- a/mbbsd/record.c
+++ b/mbbsd/record.c
@@ -81,6 +81,7 @@ int
get_record(const char *fpath, void *rptr, int size, int id)
{
int fd = -1;
+ /* TODO merge with get_records() */
if (id >= 1 && (fd = open(fpath, O_RDONLY, 0)) != -1) {
if (lseek(fd, (off_t) (size * (id - 1)), SEEK_SET) != -1) {