2016-12-02 8:48 GMT+01:00 Guillermo Rodriguez Garcia
<[email protected]>:
> 2016-12-01 21:13 GMT+01:00 Daniel Sabogal <[email protected]>:
>> On Wed, Nov 30, 2016 at 5:52 PM, Denys Vlasenko
>> <[email protected]> wrote:
[...]
>>
>> This does prevent the segfault, but I'm not sure if depending on being able
>> to
>> modify the result of dirname() is reliable.
(sorry for the previous empty mail)
I don't think it is reliable. The manpage for dirname says (emphasis mine):
These functions may return pointers to statically allocated memory
which may be overwritten by subsequent calls. Alternatively, they may
return a pointer to some part of path, so that *the string referred to
by path should not be modified or freed* until the pointer returned by
the function is no longer required.
Best,
Guillermo Rodriguez Garcia
[email protected]
_______________________________________________
busybox mailing list
[email protected]
http://lists.busybox.net/mailman/listinfo/busybox