Subject: bug#9318: 23.3.50; The first call of encode-coding-region() returns wrong result

From: Kenichi Handa <[email-masked]>
Date: Tue, 06 Dec 2011 09:30:33 +0900

In article <[email-masked]>, Paul Eggert <[email-masked]> writes:

> That patch (bzr 106613) causes Emacs to use an uninitialized variable;
> I found this via static checking with GCC.  I installed the following
> further patch, which I think is right and anyway does not introduce a bug --
> can you please check it?  Thanks.

Oops, my fault.  Yes, your patch is correct.  Thank you.

---
Kenichi Handa
[email-masked]

> * coding.c (encode_designation_at_bol): Don't use uninitialized
> local variable (Bug#9318).
> === modified file 'src/coding.c'
> --- src/coding.c	2011-12-05 07:03:31 +0000
> +++ src/coding.c	2011-12-05 09:00:44 +0000
> @@ -4356,7 +4356,7 @@
>  			   int *charbuf, int *charbuf_end,
>  			   unsigned char *dst)
>  {
> -  unsigned char *orig;
> +  unsigned char *orig = dst;
>    struct charset *charset;
>    /* Table of charsets to be designated to each graphic register.  */
>    int r[4];