cmd: Avoid mixing signed and unsigned type in conditional expression

Eric Pouech eric.pouech at orange.fr
Thu Oct 27 01:38:04 CDT 2011


why do we check for ptr being null or not, when we deref ptr one line above
?
something's wrong in the code logic
A+

Le 27 octobre 2011 04:53, Frédéric Delanoy <frederic.delanoy at gmail.com> a
écrit :

> ---
>  programs/cmd/wcmdmain.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/programs/cmd/wcmdmain.c b/programs/cmd/wcmdmain.c
> index 56aa85f..1bcc598 100644
> --- a/programs/cmd/wcmdmain.c
> +++ b/programs/cmd/wcmdmain.c
> @@ -278,7 +278,7 @@ static void WCMD_output_asis_handle (DWORD std_handle,
> const WCHAR *message) {
>         ptr++;
>       };
>       if (*ptr == '\n') ptr++;
> -      WCMD_output_asis_len(message, (ptr) ? ptr - message :
> strlenW(message), handle);
> +      WCMD_output_asis_len(message, (ptr) ? (DWORD)(ptr - message) :
> strlenW(message), handle);
>       if (ptr) {
>         numChars = 0;
>         if (++line_count >= max_height - 1) {
> --
> 1.7.7.1
>
>
>
>


-- 
-- 
Eric Pouech
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.winehq.org/pipermail/wine-devel/attachments/20111027/0473536a/attachment.html>


More information about the wine-devel mailing list