:: Re: [DNG] Pointer error in the back…
Página superior
Eliminar este mensaje
Responder a este mensaje
Autor: Edward Bartolo
Fecha:  
A: aitor_czr
Cc: dng
Asunto: Re: [DNG] Pointer error in the backend of Netman
Hi Aitor,

This is my latest edit of the code so that memory allocations are done
when needed instead of the iteration just before more memory is
required.

The edited code:
                if (z == 1)
            active_wifi_list = calloc(10, sizeof(void*));
        else if ((z - 1) % 20 == 0)
            active_wifi_list = realloc(active_wifis, (((z - 1)/2) + 10)*sizeof(void*));



Edward

On 06/12/2015, aitor_czr <aitor_czr@???> wrote:
> Hi Edward,
>
> I will try it later, thanks :)
>
>    Aitor.

>
> On 12/06/2015 01:10 PM, Edward Bartolo wrote:
>> Hi Aitor,
>>
>> I edited the code as follows:
>>
>>         if (z == 1)
>>             active_wifi_list = calloc(10, sizeof(void*));
>>         else if (z % 20 == 0)
>>             active_wifi_list = realloc(active_wifis, ((z/2) + 10)*sizeof(void*));

>>
>> Please, if you can run the code and reply back whether it worked. My
>> neighbourhood has less than 10 active wifi repeaters.
>>
>> Edward
>
>