Re: [PATCH v2] libtraceeval: Fix comparing unsigned against zero

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Oct 03, 2023 at 09:10:32AM -0400, Steven Rostedt wrote:
> From: "Steven Rostedt (Google)" <rostedt@xxxxxxxxxxx>
> 
> nr_key_types and nr_val_types are both size_t which is an unsized number.
> A compare against zero is always false:
> 
> 	if (teval->nr_key_types < 0)
> 
> Change them to ssize_t (signed type).
> 
> Also change the few places the "size_t i" is used where it does:
> 
> 	for (; i >= 0; i--)
> 
> as that too needs to be signed to work.
> 
> Signed-off-by: Steven Rostedt (Google) <rostedt@xxxxxxxxxxx>

Reviewed-by: Ross Zwisler <zwisler@xxxxxxxxxx>




[Index of Archives]     [Linux USB Development]     [Linux USB Development]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux