summaryrefslogtreecommitdiff
path: root/enc
diff options
context:
space:
mode:
authornaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-01-29 00:56:10 +0000
committernaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-01-29 00:56:10 +0000
commit6899b6ff8065daea6f87bfda1ab157738a60f09d (patch)
tree04a372fe7455f1402df8faeb7a3979be62a98efa /enc
parent796931aa09fc14fc03abba3691e7a214206adf49 (diff)
downloadruby-6899b6ff8065daea6f87bfda1ab157738a60f09d.tar.gz
* enc/trans/utf8_mac.trans (buf_shift_char): don't see uninitialised
value. [ruby-dev:40233] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26464 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'enc')
-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