summaryrefslogtreecommitdiffstats
path: root/mbbsd/brc.c
diff options
context:
space:
mode:
Diffstat (limited to 'mbbsd/brc.c')
-rw-r--r--mbbsd/brc.c12
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));