Re: Debian backend update



> ret->name = (char*)calloc(strlen(name),sizeof(char));
> strcpy(ret->name, name);

Err, surely just: ret->name = g_strdup (name) ?

> void ifparser_init()
> {
>         FILE *inp = fopen(INTERFACES,"r");
>         int ret = 0;
>         first = last = NULL;
>         while(1)
>         {
>                 char *line,rline[255],*space;
>                 if (ret == EOF)
>                         break;
>                 ret = fscanf(inp,"%255[^\n]\n",rline);

You aren't checking for inp being NULL.





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]