summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorscw <scw@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2004-05-21 14:48:51 +0800
committerscw <scw@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2004-05-21 14:48:51 +0800
commit919bd1cabc73f19279bd94f8bbae1b26bee84e87 (patch)
treef6f3bcbf76b1b1eb9aefcf211d5c5385bf6a1a27
parentfa7aa35ff05511295404e8ca86ca54dc15256770 (diff)
downloadpttbbs-919bd1cabc73f19279bd94f8bbae1b26bee84e87.tar
pttbbs-919bd1cabc73f19279bd94f8bbae1b26bee84e87.tar.gz
pttbbs-919bd1cabc73f19279bd94f8bbae1b26bee84e87.tar.bz2
pttbbs-919bd1cabc73f19279bd94f8bbae1b26bee84e87.tar.lz
pttbbs-919bd1cabc73f19279bd94f8bbae1b26bee84e87.tar.xz
pttbbs-919bd1cabc73f19279bd94f8bbae1b26bee84e87.tar.zst
pttbbs-919bd1cabc73f19279bd94f8bbae1b26bee84e87.zip
Fix disconnection when leaving board.
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@2010 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
-rw-r--r--mbbsd/brc.c16
-rw-r--r--mbbsd/name.c2
2 files changed, 12 insertions, 6 deletions
diff --git a/mbbsd/brc.c b/mbbsd/brc.c
index ede94386..7ad5e30c 100644
--- a/mbbsd/brc.c
+++ b/mbbsd/brc.c
@@ -184,16 +184,22 @@ brc_insert_record(brcbid_t bid, brcnbrd_t num, time_t* list)
} else {
/* ptr points to the old current brc list.
* tmpp is the end of it (exclusive). */
- char *tmpp = ptr + sizeof(brcbid_t) + sizeof(brcnbrd_t)
- + tnum * sizeof(time_t);
+ int len = sizeof(brcbid_t) + sizeof(brcnbrd_t) + tnum * sizeof(time_t);
+ char *tmpp = ptr + len;
end_size = brc_buf + brc_size - tmpp;
if (num) {
+ int sindex = ptr - brc_buf;
new_size = sizeof(brcbid_t) + sizeof(brcnbrd_t)
+ num * sizeof(time_t);
brc_size += new_size - (tmpp - ptr);
- if (brc_size > brc_alloc && ! brc_enlarge_buf() ) {
- end_size -= brc_size - BRC_MAXSIZE;
- brc_size = BRC_MAXSIZE;
+ if (brc_size > brc_alloc) {
+ if (brc_enlarge_buf()) {
+ ptr = brc_buf + sindex;
+ tmpp = ptr + len;
+ } else {
+ end_size -= brc_size - BRC_MAXSIZE;
+ brc_size = BRC_MAXSIZE;
+ }
}
if (end_size > 0 && ptr + new_size != tmpp)
memmove(ptr + new_size, tmpp, end_size);
diff --git a/mbbsd/name.c b/mbbsd/name.c
index 3cb2b698..9fe2ce97 100644
--- a/mbbsd/name.c
+++ b/mbbsd/name.c
@@ -2,7 +2,7 @@
#include "bbs.h"
static word_t *current = NULL;
-static char *msg_more = "\033[7m-- More --\033[m";
+static char *msg_more = "-- More --";
typedef char (*arrptr)[];
/* name complete for user ID */