about summary refs log tree commit diff
path: root/iconvdata/tcvn5712-1.c
diff options
context:
space:
mode:
Diffstat (limited to 'iconvdata/tcvn5712-1.c')
-rw-r--r--iconvdata/tcvn5712-1.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/iconvdata/tcvn5712-1.c b/iconvdata/tcvn5712-1.c
index 09dcbbfac9..90c8610f96 100644
--- a/iconvdata/tcvn5712-1.c
+++ b/iconvdata/tcvn5712-1.c
@@ -378,8 +378,9 @@ static const struct
     /* Determine whether there is a buffered character pending.  */	      \
     last_ch = *statep >> 3;						      \
 									      \
-    /* We have to buffer ch if it is a possible match in comp_table_data.  */ \
-    must_buffer_ch = last_ch && (ch >= 0x0041 && ch <= 0x01b0);		      \
+    /* We have to buffer ch if it is a possible match in comp_table_data      \
+       and if it isn't the last char of the string.  */			      \
+    must_buffer_ch = (ch >= 0x0041 && ch <= 0x01b0) && (inptr + 1 != inend);  \
 									      \
     if (last_ch)							      \
       {									      \