diff options
-rw-r--r-- | mbbsd/bbs.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/mbbsd/bbs.c b/mbbsd/bbs.c index d615f94c..50094bd3 100644 --- a/mbbsd/bbs.c +++ b/mbbsd/bbs.c @@ -1341,8 +1341,8 @@ do_add_recommend(char *direct, fileheader_t *fhdr, int ent, char *buf, int type) //Ptt: update only necessary if( (fd = open(direct, O_WRONLY)) < 0 ) return -1; - if( lseek(fd, (off_t)(sizeof(*fhdr) * (ent - 1) + - (int)fhdr->recommend - (int)fhdr), SEEK_SET) >= 0) + if( lseek(fd, (off_t)(sizeof(fileheader_t) * (ent - 1) + + (int)&fhdr->recommend - (int)fhdr), SEEK_SET) >= 0) // 如果 lseek 失敗就不會 write write(fd, &fhdr->recommend, sizeof(char)); |