summaryrefslogtreecommitdiff
path: root/enc/trans
diff options
context:
space:
mode:
Diffstat (limited to 'enc/trans')
-rw-r--r--enc/trans/utf8_mac.trans6
1 files changed, 3 insertions, 3 deletions
diff --git a/enc/trans/utf8_mac.trans b/enc/trans/utf8_mac.trans
index 7569c34ac0..ecda465355 100644
--- a/enc/trans/utf8_mac.trans
+++ b/enc/trans/utf8_mac.trans
@@ -85,10 +85,10 @@ buf_shift(struct from_utf8_mac_status *sp)
void
buf_shift_char(struct from_utf8_mac_status *sp)
{
- while (sp->beg != sp->end) {
+ if (sp->beg == sp->end) return;
+ do {
buf_shift(sp);
- if ((sp->buf[sp->beg] & 0xC0) != 0x80) break;
- }
+ } while (sp->beg != sp->end && (sp->buf[sp->beg] & 0xC0) == 0x80);
}
void