[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 3/7] name_equal: return early from function if src null-termi
From: |
Marin Ramesa |
Subject: |
Re: [PATCH 3/7] name_equal: return early from function if src null-terminates in the loop |
Date: |
Mon, 16 Sep 2013 10:10:19 +0200 |
On 16.09.2013 09:38:35, Samuel Thibault wrote:
> Marin Ramesa, le Mon 16 Sep 2013 08:30:44 +0200, a écrit :
> > Actually, it changes the behavior when the values at the memory
> > locations beyond null-termination are equal.
Sorry. The other version does this. It's what I intented.
> Err, but the added lines do not break the loop at the
> null-termination, so I still don't understand what changes.
'src' null-terminates and 'target' doesn't, so the loop breaks. If it
didn't break it would enter another iteration and the pointer would
increment after comparison going to address beyond the address of null-
termination. So, it just prevents this. My change is partial and
doesn't do what I actually wanted to do.
[PATCH 4/7] another small change in style for consistency, Marin Ramesa, 2013/09/13
[PATCH 5/7] remove preprocessor comments, Marin Ramesa, 2013/09/13
[PATCH 6/7] use boolean_t instead of an int, Marin Ramesa, 2013/09/13
[PATCH 7/7] another small change in style for consistency, Marin Ramesa, 2013/09/13
Re: Small cleanup of device name routines, Samuel Thibault, 2013/09/15