diff options
author | victor <victor@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2004-09-10 08:49:47 +0800 |
---|---|---|
committer | victor <victor@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2004-09-10 08:49:47 +0800 |
commit | 540cfa70e8e8b4db3cc2addccfcbeeb69fffa033 (patch) | |
tree | 6a4dec7d69249e48a6f79c4436eb634cb28744b2 /mbbsd/brc.c | |
parent | a8a0ef3c4d10bf576054dc26348d9b4e6efeecc2 (diff) | |
download | pttbbs-540cfa70e8e8b4db3cc2addccfcbeeb69fffa033.tar pttbbs-540cfa70e8e8b4db3cc2addccfcbeeb69fffa033.tar.gz pttbbs-540cfa70e8e8b4db3cc2addccfcbeeb69fffa033.tar.bz2 pttbbs-540cfa70e8e8b4db3cc2addccfcbeeb69fffa033.tar.lz pttbbs-540cfa70e8e8b4db3cc2addccfcbeeb69fffa033.tar.xz pttbbs-540cfa70e8e8b4db3cc2addccfcbeeb69fffa033.tar.zst pttbbs-540cfa70e8e8b4db3cc2addccfcbeeb69fffa033.zip |
merge back from branch victor.solaris
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@2189 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'mbbsd/brc.c')
-rw-r--r-- | mbbsd/brc.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/mbbsd/brc.c b/mbbsd/brc.c index 7e61e578..45b001a4 100644 --- a/mbbsd/brc.c +++ b/mbbsd/brc.c @@ -96,8 +96,9 @@ time_t * brc_find_record(int bid, int *num) { char *p; - *num = 0; - p = brc_findrecord_in(brc_buf, brc_buf + brc_size, bid, (brcnbrd_t*)num); + brcnbrd_t tnum; + p = brc_findrecord_in(brc_buf, brc_buf + brc_size, bid, &tnum); + *num = tnum; if (p) return (time_t*)(p + sizeof(brcbid_t) + sizeof(brcnbrd_t)); *num = 0; @@ -187,7 +188,7 @@ brc_insert_record(brcbid_t bid, brcnbrd_t num, time_t* list) num--; /* don't write the times before brc_expire_time */ if (!ptr) { - brc_size -= tnum; + brc_size -= (int)tnum; /* put on the beginning */ if (num){ @@ -333,8 +334,9 @@ brc_initialize(){ int brc_read_record(int bid, int *num, time_t *list){ char *ptr; - *num = 0; - ptr = brc_findrecord_in(brc_buf, brc_buf + brc_size, bid, (brcnbrd_t*)num); + brcnbrd_t tnum; + ptr = brc_findrecord_in(brc_buf, brc_buf + brc_size, bid, &tnum); + *num = tnum; if ( ptr ){ memcpy(list, ptr + sizeof(brcbid_t) + sizeof(brcnbrd_t), *num * sizeof(time_t)); |