summaryrefslogtreecommitdiff
path: root/iconvdata
diff options
context:
space:
mode:
Diffstat (limited to 'iconvdata')
-rw-r--r--iconvdata/iso-2022-jp.c2
-rw-r--r--iconvdata/iso-2022-kr.c2
2 files changed, 4 insertions, 0 deletions
diff --git a/iconvdata/iso-2022-jp.c b/iconvdata/iso-2022-jp.c
index 669b65afae..a3c9f7d354 100644
--- a/iconvdata/iso-2022-jp.c
+++ b/iconvdata/iso-2022-jp.c
@@ -212,6 +212,8 @@ gconv_end (struct __gconv_step *data)
*outbuf++ = ESC; \
*outbuf++ = '('; \
*outbuf++ = 'B'; \
+ if (data->__is_last) \
+ *written += 3; \
data->__outbuf = outbuf; \
/* Note that this also clears the G2 designation. */ \
data->__statep->count = ASCII_set; \
diff --git a/iconvdata/iso-2022-kr.c b/iconvdata/iso-2022-kr.c
index 178753f5c8..8c1d88b12c 100644
--- a/iconvdata/iso-2022-kr.c
+++ b/iconvdata/iso-2022-kr.c
@@ -92,6 +92,8 @@ enum
{ \
/* Write out the shift sequence. */ \
*outbuf++ = SI; \
+ if (data->__is_last) \
+ *written += 1; \
data->__outbuf = outbuf; \
data->__statep->count = ASCII_set; \
} \