[prev in list] [next in list] [prev in thread] [next in thread] 

List:       busybox
Subject:    Re: [PATCH 1/6] libbb: Fix trim
From:       Samuel Mendoza-Jonas <sam () mendozajonas ! com>
Date:       2018-05-09 6:52:56
Message-ID: 5c81a595ed5dd180cb810894566cf3c5834391f3.camel () mendozajonas ! com
[Download RAW message or body]

On Wed, 2018-05-09 at 08:31 +0200, Xabier Oneca -- xOneca wrote:
> Hi,
> 
> 2018-05-08 8:30 GMT+02:00 Samuel Mendoza-Jonas <sam@mendozajonas.com>:
> > Commit 20077c14, "make trim() return pointer to terminating NULL",
> > avoids a superfluous store if the string doesn't need to be trimmed, but
> > accidentally returns a pointer to the end of the string.
> 
> That's an intended behaviour that other code modified in the same
> commit relies upon.

Ah, I missed the change from void to char* - so udhcp_str2optset()
shouldn't be using the pointer returned by trim(), but saving the
original pointer value. Thanks for the correction, I'll fix that in V2.

> 
> > Move the 's += len' statement to inside the if statement to make sure we
> > return a pointer to the start of the string.
> 
> 
> Then those other functions will have to be modified too...
> 
> Cheers,
> Xabier Oneca_,,_
> _______________________________________________
> busybox mailing list
> busybox@busybox.net
> http://lists.busybox.net/mailman/listinfo/busybox

_______________________________________________
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic