[sane-devel] uninitialized variables in sane-backends

Henning Meier-Geinitz henning at meier-geinitz.de
Thu Jan 5 21:50:37 UTC 2006


Hi,

On 2006-01-05 13:57, Johannes Meixner wrote:
> --- backend/genesys.c.orig      2006-01-03 11:57:23.000000000 +0100
> +++ backend/genesys.c   2006-01-03 12:04:25.000000000 +0100
> @@ -2686,7 +2686,7 @@
>    u_int8_t channels;
>    int x, j, o;
>    unsigned int i;
> -  unsigned int coeff, target_code, val, avgpixels, dk, words_per_color;
> +  unsigned int coeff, target_code, val, avgpixels, dk, words_per_color = 0;

Thanks, fixed together with some other warnings.

> In genesys.c it might be better to change the switch which
> sets words_per_color so that there is a default case.

This is not enough to silence the warning beacuse the switch is inside
an if statement. Setting the variable to 0 should at least make
visiable any unexcpected cases.

Bye,
  henning



More information about the sane-devel mailing list