summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ext/mbstring/mbfilter_kr.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/ext/mbstring/mbfilter_kr.c b/ext/mbstring/mbfilter_kr.c
index f5d2ca4c98..0d7e7efce8 100644
--- a/ext/mbstring/mbfilter_kr.c
+++ b/ext/mbstring/mbfilter_kr.c
@@ -373,7 +373,7 @@ mbfl_filt_conv_wchar_2022kr(int c, mbfl_convert_filter *filter TSRMLS_DC)
int
mbfl_filt_conv_uhc_wchar(int c, mbfl_convert_filter *filter TSRMLS_DC)
{
- int c1, w, flag;
+ int c1, w = 0, flag = 0;
switch (filter->status) {
case 0:
@@ -392,10 +392,10 @@ mbfl_filt_conv_uhc_wchar(int c, mbfl_convert_filter *filter TSRMLS_DC)
case 1: /* dbcs second byte */
filter->status = 0;
c1 = filter->cache;
-
if ( c1 >= 0x81 && c1 <= 0xa0){
w = (c1 - 0x81)*190 + (c - 0x41);
if (w >= 0 && w < uhc1_ucs_table_size) {
+ flag = 1;
w = uhc1_ucs_table[w];
} else {
w = 0;
@@ -403,6 +403,7 @@ mbfl_filt_conv_uhc_wchar(int c, mbfl_convert_filter *filter TSRMLS_DC)
} else if ( c1 >= 0xa1 && c1 <= 0xc6){
w = (c1 - 0xa1)*190 + (c - 0x41);
if (w >= 0 && w < uhc2_ucs_table_size) {
+ flag = 2;
w = uhc2_ucs_table[w];
} else {
w = 0;
@@ -410,6 +411,7 @@ mbfl_filt_conv_uhc_wchar(int c, mbfl_convert_filter *filter TSRMLS_DC)
} else if ( c1 >= 0xc7 && c1 <= 0xfe){
w = (c1 - 0xc7)*94 + (c - 0xa1);
if (w >= 0 && w < uhc3_ucs_table_size) {
+ flag = 3;
w = uhc3_ucs_table[w];
} else {
w = 0;