shellpath.c: Avoid copying invalid data on error

Alexandre Julliard julliard at winehq.org
Fri Oct 22 16:41:32 CDT 2004


Juan Lang <juan_lang at yahoo.com> writes:

> The following is a better patch, I think, in that
> - it doesn't add a break statement to the default case
> (some compilers warn on this)

I seriously doubt that, what compiler does this for you?  It's much
better practice to always add break to all cases, otherwise when
someone adds some code at the end of the switch they will forget to
add a break to the previous case.

> -    WCHAR      szBuildPath[MAX_PATH], szTemp[MAX_PATH];
> +    WCHAR      szBuildPath[MAX_PATH], szTemp[MAX_PATH] = { 0 };

This fills the whole buffer with zeroes, that's not really needed.

-- 
Alexandre Julliard
julliard at winehq.org



More information about the wine-devel mailing list