[PATCH 1/6] libbb: Fix trim

Xabier Oneca -- xOneca xoneca at gmail.com
Wed May 9 06:31:26 UTC 2018


Hi,

2018-05-08 8:30 GMT+02:00 Samuel Mendoza-Jonas <sam at 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.

> 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_,,_


More information about the busybox mailing list