Re: [hackers] [slock] [PATCH] Refactor main()

From: Anselm R Garbe <garbeam_AT_gmail.com>
Date: Mon, 22 Aug 2016 09:30:29 +0200

Two spots:

First, why using

/*
 * tiny comment
 */

instead of
/* tiny comment */

Second, why introducing superfluous scope brackets?

I prefer

if (!(dpy = XOpenDisplay(0)))
    die("cannot open display\n");


to cumbersome:

if (!(dpy = XOpenDisplay(NULL))) {
    die("slock: cannot open display\n");
}

BR,
Anselm


On 22 August 2016 at 09:14, FRIGN <dev_AT_frign.de> wrote:
> Good morning fellow hackers,
>
> after discussing this with Markus we agreed that it is time for slock
> to have a refactor so it benefits from all the best practices(tm) we
> learned about in the last few years and worked out working on sbase and
> other projects.
>
> In the long run the target is to go through each function and very
> strictly do error checks where necessary and also reduce global state
> where it might be a problem. Given slock is suid, we don't want to take
> any risks and provide as little attack surface as possible.
>
> Besides stricter error checking this patch also improves the usage and
> makes the code more readable by pulling in arg.h, which has proven to
> be very useful in the last few years.
>
> Please provide feedback on this patch and test it.
>
> Cheers
>
> FRIGN
>
> --
> FRIGN <dev_AT_frign.de>
Received on Mon Aug 22 2016 - 09:30:29 CEST

This archive was generated by hypermail 2.3.0 : Mon Aug 22 2016 - 09:36:15 CEST