summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorvictor <victor@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2003-07-04 19:37:02 +0800
committervictor <victor@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2003-07-04 19:37:02 +0800
commit8a1cf189dd04d506d835a9d19e7cdc13c38929e2 (patch)
tree337b46e9cc37fdb60b04c25e4285571f0a93c809
parenta4743dd2f4f432ee8894f488bd0cbd9d77248c01 (diff)
downloadpttbbs-8a1cf189dd04d506d835a9d19e7cdc13c38929e2.tar
pttbbs-8a1cf189dd04d506d835a9d19e7cdc13c38929e2.tar.gz
pttbbs-8a1cf189dd04d506d835a9d19e7cdc13c38929e2.tar.bz2
pttbbs-8a1cf189dd04d506d835a9d19e7cdc13c38929e2.tar.lz
pttbbs-8a1cf189dd04d506d835a9d19e7cdc13c38929e2.tar.xz
pttbbs-8a1cf189dd04d506d835a9d19e7cdc13c38929e2.tar.zst
pttbbs-8a1cf189dd04d506d835a9d19e7cdc13c38929e2.zip
fix last commit bug
git-svn-id: http://opensvn.csie.org/pttbbs/pttbbs/trunk/pttbbs@1021 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
-rw-r--r--mbbsd/read.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/mbbsd/read.c b/mbbsd/read.c
index e66ab22c..cc5f480a 100644
--- a/mbbsd/read.c
+++ b/mbbsd/read.c
@@ -1,4 +1,4 @@
-/* $Id: read.c,v 1.25 2003/07/02 08:04:01 victor Exp $ */
+/* $Id: read.c,v 1.26 2003/07/04 11:37:02 victor Exp $ */
#include "bbs.h"
static fileheader_t *headers = NULL;
@@ -562,6 +562,8 @@ i_read_key(onekey_t * rcmdlist, keeploc_t * locmem, int ch, int bid)
case KEY_LEFT:
if(currmode & MODE_SELECT){
char genbuf[256];
+ int num;
+
fileheader_t *fhdr = &headers[locmem->crs_ln - locmem->top_ln];
board_select();
@@ -569,7 +571,8 @@ i_read_key(onekey_t * rcmdlist, keeploc_t * locmem, int ch, int bid)
locmem = getkeep(genbuf, 0, 1);
locmem->crs_ln = getindex(genbuf, fhdr->filename, sizeof(fileheader_t));
- locmem->top_ln = locmem->crs_ln - p_lines + 1;
+ num = locmem->crs_ln - p_lines + 1;
+ locmem->top_ln = num < 1 ? 1 : num;
return NEWDIRECT;
}