summaryrefslogtreecommitdiffstats
path: root/mbbsd/visio.c
diff options
context:
space:
mode:
authorpiaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2008-04-17 23:44:28 +0800
committerpiaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2008-04-17 23:44:28 +0800
commitde354f73c4a69c9349102cbc8dd507a0d616bc9d (patch)
treeb7162cbedfc357e54e31674c9cf4dffcb0c08794 /mbbsd/visio.c
parent5085764644bc8d6540481eb6a08c8c1baaa66291 (diff)
downloadpttbbs-de354f73c4a69c9349102cbc8dd507a0d616bc9d.tar
pttbbs-de354f73c4a69c9349102cbc8dd507a0d616bc9d.tar.gz
pttbbs-de354f73c4a69c9349102cbc8dd507a0d616bc9d.tar.bz2
pttbbs-de354f73c4a69c9349102cbc8dd507a0d616bc9d.tar.lz
pttbbs-de354f73c4a69c9349102cbc8dd507a0d616bc9d.tar.xz
pttbbs-de354f73c4a69c9349102cbc8dd507a0d616bc9d.tar.zst
pttbbs-de354f73c4a69c9349102cbc8dd507a0d616bc9d.zip
- register: add log for "assigning specific user to validate".
- visio: better check to prevent input half big5 characters git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@4181 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'mbbsd/visio.c')
-rw-r--r--mbbsd/visio.c15
1 files changed, 6 insertions, 9 deletions
diff --git a/mbbsd/visio.c b/mbbsd/visio.c
index b0949d01..5a72b698 100644
--- a/mbbsd/visio.c
+++ b/mbbsd/visio.c
@@ -1013,18 +1013,15 @@ vgetstring(char *_buf, int len, int flags, const char *defstr, const VGET_CALLBA
{
bell(); continue;
}
+
// prevent incomplete DBCS
- // this check only works if DBCS-aware is active.
- // Otherwise, non-DBCS-aware users will fail to
- // input the final DBCS-TRAIL character.
-#ifdef DBCSAWARE
- if (ISDBCSAWARE() &&
- c > 0x80 && iend+2 >= len &&
- !CHKDBCSTRAIL(buf, icurr) )
+ if (c > 0x80 && num_in_buf() &&
+ len - iend < 3) // we need 3 for DBCS+NUL.
{
- bell(); continue;
+ drop_input();
+ bell();
+ continue;
}
-#endif // DBCSAWARE
// callback 2: data
if (_vgetcbhandler(cb.data, &abort,