X-Git-Url: http://mj.ucw.cz/gitweb/?a=blobdiff_plain;f=charset%2Fcharconv-gen.h;h=1c76b12a2d4e5328397491cc4c80ea0fab66e844;hb=305df0095d05525e1324cbc7c74d764535338b07;hp=5a83232f7aaad432281d8969e34f7e807717b349;hpb=621ee40d3853fdcfead7af0f1a8631dc2e2d5083;p=libucw.git diff --git a/charset/charconv-gen.h b/charset/charconv-gen.h index 5a83232f..1c76b12a 100644 --- a/charset/charconv-gen.h +++ b/charset/charconv-gen.h @@ -13,6 +13,7 @@ do { /*** Header ***/ + const byte *s, *se; byte *d, *de; uns code; @@ -138,7 +139,7 @@ got_code: { byte *k = string_table + code - 0x100; uns len = *k++; - if (unlikely(de - d < len)) + if (unlikely((uns)(de - d) < len)) { c->state = SEQ_WRITE; c->string_at = k; @@ -193,6 +194,7 @@ got_code: else { write_slow: + c->code = code; c->state = UTF16_BE_WRITE; goto go_slow; } @@ -217,6 +219,7 @@ write_slow: else { write_slow: + c->code = code; c->state = UTF16_LE_WRITE; goto go_slow; }