On Mon, May 8, 2017 at 6:32 AM, Alex Bennée <[email protected]> wrote:
>> diff --git a/hw/xtensa/sim.c b/hw/xtensa/sim.c
>> index d2d1d3a6fd..97307728f7 100644
>> --- a/hw/xtensa/sim.c
>> +++ b/hw/xtensa/sim.c
>> @@ -41,13 +41,13 @@ static void xtensa_create_memory_regions(const 
>> XtensaMemory *memory,
>>                                           const char *name)
>>  {
>>      unsigned i;
>> -    char *num_name = malloc(strlen(name) + sizeof(i) * 3 + 1);
>> +    char *num_name = g_malloc(strlen(name) + sizeof(i) * 3 + 1);
>
> It seems a little sketchy using the size of the storage type as a proxy
> for the number of bytes used by the format specifier in a format string.
> In this sort of situation I'd just use Glib and stop worrying about it:

Ok, I'll send a patch doing it that way.

-- 
Thanks.
-- Max

Reply via email to