[Geany-devel] Weird Segfault Crash

Nick Treleaven nick.treleaven at xxxxx
Mon Jan 2 15:54:40 UTC 2012


On 02/01/2012 14:33, Colomban Wendling wrote:
>>      encodings_convert_to_utf8_from_charset(utf8_name, (gsize) -1, ...)
>> >
>> >  Is it OK the cast a negative number to `gsize` and will it have the
>> >  desired effect for that function? The `-1` here is supposed to tell the
>> >  encoding function that the string is nul terminated and is to be
>> >  measured with `strlen()` IIUC.
> It's ugly, but AFAIK it'll work fine everywhere since it's casted back
> to gssize in that function.  But you're right, it should definitely be a
> gssize parameter.  Unfortunately this function is in the plugin API, and
> I'm not sure of the implications of changing that parameter's type...

That should be fixed. I'm not sure whether it needs an ABI break or not 
(guess not), but if the parameter can be -1 then make it gssize.

Nick



More information about the Devel mailing list