[Michał Kulling]
> Hi all,

Hi. :)

> I'll present all my patches for init.c, which patching several bugs
> from Coverity - you can dismiss my yesterday message. All patches
> was created on previous, patched file.

Thank you very much. :)

> --- init.c-orig       2014-02-10 20:41:50.922024360 +0100
> +++ init.c    2014-02-10 20:40:09.786021955 +0100
> @@ -372,34 +372,74 @@
>                       case C_REC:
>                               break;
>                       case D_RUNLEVEL:
> -                             fscanf(f, "%c\n", &runlevel);
> -                             break;
> +                             if(fscanf(f, "%c\n", &runlevel) < 0){
> +                                     fprintf(stderr, "Read state pipe: 
> %s\n", strerror(errno));
> +                                     oops_error = -1;
> +                                     return NULL;
> +                             }
> +                     break;

Perhaps the if(fscanf)...} part should be made into a function or
macro, to avoid duplicate code?  It is repeated quite a lot of times.

-- 
Happy hacking
Petter Reinholdtsen

Reply via email to