Source-Changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: CVS commit: src/sbin/init



On Mon, Feb 05, 2007 at 10:36:18PM +0000, Christian Biere wrote:
> 
> Module Name:  src
> Committed By: cbiere
> Date:         Mon Feb  5 22:36:18 UTC 2007
> 
> Modified Files:
>       src/sbin/init: init.c
...
>  * writefile():
>    * Avoid unnecessary return statements.

The code is actually more readable the old way.
There is absolutely nothing wrong woth functions having multiple 'return'
statments in order to save the human reader having to parse the rest of
the if/else/endif clauses in the file.

what is the:
        if (...
            S_ISREG(st.st_mode) &&
            st.st_size > 0 &&
            (uintmax_t)(intmax_t)st.st_size < SIZE_MAX) {
checkall about ?  (apart from wasting code space).

Also I have every reason to believe that 'else if' is discouraged by
the netbsd style guide.

        David

-- 
David Laight: david%l8s.co.uk@localhost



Home | Main Index | Thread Index | Old Index