(decode_coding): Fix handling of invalid bytes.
authorKenichi Handa <handa@m17n.org>
Sat, 15 Oct 2005 02:09:14 +0000 (02:09 +0000)
committerKenichi Handa <handa@m17n.org>
Sat, 15 Oct 2005 02:09:14 +0000 (02:09 +0000)
src/coding.c

index 15130b9..1a9b13f 100644 (file)
@@ -6208,7 +6208,9 @@ decode_coding (coding)
            {
              int c = *src++;
 
-             coding->charbuf[coding->charbuf_used++] = (c & 0x80 ? - c : c);
+             if (c & 0x80)
+               c = BYTE8_TO_CHAR (c);
+             coding->charbuf[coding->charbuf_used++] = c;
            }
          produce_chars (coding, Qnil, 1);
        }