cmd: Avoid mixing signed and unsigned type in conditional expression

Michael Stefaniuc mstefani at redhat.com
Thu Oct 27 07:49:29 CDT 2011


On 10/27/2011 02:09 PM, Frédéric Delanoy wrote:
> On Thu, Oct 27, 2011 at 08:38, Eric Pouech <eric.pouech at orange.fr> wrote:
>> why do we check for ptr being null or not, when we deref ptr one line above?
> 
>>>       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) {
> 
> It's dereferenced but incremented afterwards, so might be null after that line
Only if ptr wraps around ;)

bye
	michael



More information about the wine-devel mailing list