X-Git-Url: http://mj.ucw.cz/gitweb/?a=blobdiff_plain;f=charset%2Fcharconv-gen.h;h=f4988548aedc3c19d3039f3343fb776e05ec96bf;hb=5403c0fab834f71416e627dfd7346a577a0ca6f5;hp=5a83232f7aaad432281d8969e34f7e807717b349;hpb=621ee40d3853fdcfead7af0f1a8631dc2e2d5083;p=libucw.git diff --git a/charset/charconv-gen.h b/charset/charconv-gen.h index 5a83232f..f4988548 100644 --- a/charset/charconv-gen.h +++ b/charset/charconv-gen.h @@ -13,9 +13,10 @@ do { /*** Header ***/ + const byte *s, *se; byte *d, *de; - uns code; + uint code; int e; #ifdef CONV_READ_STD @@ -27,7 +28,7 @@ do { #endif #ifdef CONV_READ_UTF8 - uns cc; + uint cc; #endif if (unlikely(c->state)) @@ -137,8 +138,8 @@ got_code: else { byte *k = string_table + code - 0x100; - uns len = *k++; - if (unlikely(de - d < len)) + uint len = *k++; + if (unlikely((uint)(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; }