[PATCH] dive.c:merge_text(): Slighly better string merge logic

Dirk Hohndel dirk at hohndel.org
Fri Mar 8 09:46:44 PST 2013


"Lubomir I. Ivanov" <neolit123 at gmail.com> writes:

> On 8 March 2013 18:55, Dirk Hohndel <dirk at hohndel.org> wrote:
>> I don't agree with this patch.
>>
>> Imagine that a="" and b="Great dive location"
>> The existing code returns a copy of "Great dive location" while your
>> code returns "() or (Great dive locations)".
>> That is not an improvement.
>>
>
> yeah, it has to be improved further.
>
>> Can you explain in more detail what you are trying to fix?
>>
>
> the backtrace of #90, showed:
> (a=0x348d770 "", b=0x0) at dive.c:911
>
> where 'a' is "", but 'b' is NULL, so it passes NULL to strdup().

So test for that :-)

I can fix this myself if you prefer.

/D


More information about the subsurface mailing list