From: Kenichi Handa Date: Wed, 23 Aug 2000 02:47:42 +0000 (+0000) Subject: (encode_eol): Fix bug for the case of dst_bytes being zero. Set X-Git-Tag: emacs-pretest-21.0.90~2018 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=78a629d2f5d3d907703b78c6a9a331c3596d7c2b;p=emacs.git (encode_eol): Fix bug for the case of dst_bytes being zero. Set coding->produced_char correctly. --- diff --git a/src/coding.c b/src/coding.c index 04fb863885a..1f10672d840 100644 --- a/src/coding.c +++ b/src/coding.c @@ -2802,7 +2802,7 @@ encode_eol (coding, source, destination, src_bytes, dst_bytes) } else { - if (src_bytes <= dst_bytes) + if (!dst_bytes || src_bytes <= dst_bytes) { safe_bcopy (src, dst, src_bytes); src_base = src_end; @@ -2834,6 +2834,7 @@ encode_eol (coding, source, destination, src_bytes, dst_bytes) coding->consumed = src_base - source; coding->produced = dst - destination; + coding->produced_char = coding->produced; }