tech-userlevel archive

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

Re: swscanf() causing Memory Fault



Christos Zoulas wrote:
> Index: vswscanf.c
> ===================================================================
> RCS file: /cvsroot/src/lib/libc/stdio/vswscanf.c,v
> retrieving revision 1.3
> diff -u -u -r1.3 vswscanf.c
> --- vswscanf.c        2 Dec 2005 13:51:22 -0000       1.3
> +++ vswscanf.c        16 Nov 2008 03:14:53 -0000
> @@ -90,6 +90,7 @@
>               return (EOF);
>       }
>       _FILEEXT_SETUP(&f, &fext);
> +     (void)memset(WCIO_GET(&f), 0, sizeof(struct wchar_io_data));
>       f._file = -1;
>       f._flags = __SRD;
>       f._bf._base = f._p = (unsigned char *)mbstr;

Why cast a discarded return code to void?  That seems overly fussy to me. 


--jkl


Home | Main Index | Thread Index | Old Index