[PATCH] oleaut32: check return code of Currency2Integer (Coverity)

Dmitry Timoshkov dmitry at baikal.ru
Thu Jun 22 01:57:50 CDT 2017


Marcus Meissner <marcus at jet.franken.de> wrote:

>  HRESULT WINAPI VarI1FromCy(CY cyIn, signed char* pcOut)
>  {
>    LONG i = I1_MAX + 1;
> +  HRESUTL hr;
>  
> -  VarI4FromCy(cyIn, &i);
> -  return _VarI1FromI4(i, pcOut);
> +  hr = VarI4FromCy(cyIn, &i);
> +
> +  if (SUCCEEDED(hr))
> +    hr = _VarI1FromI4(i, pcOut);
> +  return hr;
>  }

I guess that this change makes initialization of 'i' redundant. Here and
in remaining cases. Probably needs a test case though to make sure which
behaviour is more correct.

-- 
Dmitry.



More information about the wine-devel mailing list