:: Re: [DNG] simple-netaid from scratc…
Página Principal
Delete this message
Reply to this message
Autor: aitor_czr
Data:  
Para: s@
CC: dng
Assunto: Re: [DNG] simple-netaid from scratch
Hi s@,

On 20/5/19 22:41, s@ wrote:
> aitor_czr<aitor_czr@???> wrote:
>
>> Have a look at the server side:
>>
>> https://git.devuan.org/aitor_czr/simple-netaid/blob/master/backend_src/server.c
> char buffer[512];
> (...)
>
> You are using in some places 'sizeof(buffer)' in 'fgets()' and such..
> Your buffer has a fixed size..
>
> /* Somewere else, probably in the header file..*/
> #define BUFFER_SIZE 512;
> (...)


Yes, this is in the "netstat.c" file, but i didn't define any
BUFFER_SIZE in the "netstat.h" header.

> char buffer[ BUFFER_SIZE ];
> (...)
> status = fgets ( buffer, BUFFER_SIZE, fp );
>
> its my 2 cents:)
>
> Regards,


Look at the "netstat.c" file again. I'm using

status = fgets ( buffer, sizeof(buffer), fp );

instead :)

Aitor.