Re: shellpath.c: Avoid copying invalid data on error
Juan Lang <juan_lang(a)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(a)winehq.org
--- Alexandre Julliard <julliard(a)winehq.org> wrote:
- 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?
MSVC at certain warning levels IIRC. But my memory is suspect.
- 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.
Agreed, I prefer = "", but this is a WSTR so I can't do that. --Juan __________________________________ Do you Yahoo!? Yahoo! Mail Address AutoComplete - You start. We finish. http://promotions.yahoo.com/new_mail
participants (2)
-
Alexandre Julliard -
Juan Lang