diff options
-rw-r--r-- | pttbbs/mbbsd/bbs.c | 3 | ||||
-rw-r--r-- | pttbbs/mbbsd/edit.c | 6 | ||||
-rw-r--r-- | pttbbs/mbbsd/mail.c | 3 |
3 files changed, 5 insertions, 7 deletions
diff --git a/pttbbs/mbbsd/bbs.c b/pttbbs/mbbsd/bbs.c index c3f6391b..a68b8e79 100644 --- a/pttbbs/mbbsd/bbs.c +++ b/pttbbs/mbbsd/bbs.c @@ -1969,7 +1969,7 @@ cross_post(int ent, fileheader_t * fhdr, const char *direct) fileheader_t xfile; FILE *xptr; int xbid, hashPost; - boardheader_t *bp, *xbp; + boardheader_t *bp; assert(0<=currbid-1 && currbid-1<MAX_BOARD); bp = getbcache(currbid); @@ -2053,7 +2053,6 @@ cross_post(int ent, fileheader_t * fhdr, const char *direct) hashPost = StringHash(fhdr->filename); // let's try filename xbid = getbnum(xboard); assert(0<=xbid-1 && xbid-1<MAX_BOARD); - xbp = getbcache(xbid); if (xbid == currbid) { diff --git a/pttbbs/mbbsd/edit.c b/pttbbs/mbbsd/edit.c index 1a0b94f4..4e6c2547 100644 --- a/pttbbs/mbbsd/edit.c +++ b/pttbbs/mbbsd/edit.c @@ -264,17 +264,17 @@ int mchar_len(unsigned char *str) } #define FC_RIGHT (0) -#define FC_LEFT (~FC_RIGHT) +#define FC_LEFT (1) int fix_cursor(char *str, int pos, int dir) { int newpos, w; - assert(dir >= 0); + assert(dir == FC_RIGHT || dir == FC_LEFT); for(newpos = 0; *str != '\0' && (w = mchar_len((unsigned char*)str), - newpos + 1 + (dir & (w - 1))) <= pos; + newpos + 1 + (dir == FC_RIGHT ? 0 : w - 1) <= pos); str += w, newpos += w) ; diff --git a/pttbbs/mbbsd/mail.c b/pttbbs/mbbsd/mail.c index ae3fb56d..e4c965ce 100644 --- a/pttbbs/mbbsd/mail.c +++ b/pttbbs/mbbsd/mail.c @@ -88,7 +88,6 @@ is_valid_email(const char *full_address) int invalidaddr(const char *addr) { int r = is_valid_email(addr); - char c; if (r) return 0; @@ -106,7 +105,7 @@ invalidaddr(const char *addr) { if (bad_email_offset >= 0) { - c = addr[bad_email_offset]; + char c = addr[bad_email_offset]; prints("¿ù»~¦ì¸m: ²Ä %d ¦r¤¸: 0x%02X [ %c ]", bad_email_offset, (unsigned char)c, isascii(c) && isprint(c) ? c : ' '); |