NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: lib/48025: Uninitializied variable in citrus_utf1632.c



On Sat, Jul 06, 2013 at 02:00:00PM +0000, 
henning.petersen%t-online.de@localhost wrote:
> 
> >Fix:
> diff -u -p -r1.12 citrus_utf1632.c
> --- lib/libc/citrus/modules/citrus_utf1632.c  12 Feb 2012 13:51:29 -0000      
> 1.12
> +++ lib/libc/citrus/modules/citrus_utf1632.c  6 Jul 2013 12:27:19 -0000
> @@ -93,7 +93,7 @@ _citrus_UTF1632_mbrtowc_priv(_UTF1632Enc
>                            size_t *nresult)
>  {
>       int chlenbak, endian, needlen;
> -     wchar_t wc;
> +     wchar_t wc = L'\0';
>       size_t result;
>       const char *s0;
>  

For what it is worth, the coding standard says that you shouldn't assign
values in the declaration of the variable.  This is quite often ignored
though.

-- 
Brett Lymn
Staple Guns: because duct tape doesn't make that KerCHUNK sound - xkcd.com


Home | Main Index | Thread Index | Old Index