]> code.delx.au - gnu-emacs/blobdiff - src/coding.c
* lisp.h (toplevel): Add compile-time assert to verify suitable member layout
[gnu-emacs] / src / coding.c
index 64bad7ccbe859849a369c9ddf713d3d38c419e4e..85a50dad91fee73630463cd62adfbc3a1b752821 100644 (file)
@@ -1549,8 +1549,8 @@ encode_coding_utf_8 (struct coding_system *coding)
            *dst++ = CHAR_TO_BYTE8 (c);
          else
            CHAR_STRING_ADVANCE_NO_UNIFY (c, dst);
-         produced_chars++;
        }
+      produced_chars = dst - (coding->destination + coding->produced);
     }
   record_conversion_result (coding, CODING_RESULT_SUCCESS);
   coding->produced_char += produced_chars;
@@ -7266,7 +7266,8 @@ produce_charset (struct coding_system *coding, int *charbuf, ptrdiff_t pos)
 }
 
 #define MAX_CHARBUF_SIZE 0x4000
-#define MIN_CHARBUF_SIZE 0x10
+/* emacs-mule decoding requires more than 16 bytes.  */
+#define MIN_CHARBUF_SIZE 0x20
 
 #define ALLOC_CONVERSION_WORK_AREA(coding, size)               \
   do {                                                         \