From bd3cda801449f0ed0630637a843d8d9d6a964daa Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Sun, 22 Feb 2026 13:47:21 +0100 Subject: m fixes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- src/common.c | 34 ++++++++++++++++------------------ 1 file changed, 16 insertions(+), 18 deletions(-) (limited to 'src/common.c') diff --git a/src/common.c b/src/common.c index 78b3383..1600a80 100644 --- a/src/common.c +++ b/src/common.c @@ -1,7 +1,7 @@ /** * cerberus-logging – Log-in logging extension for cerberus * - * Copyright © 2014, 2015 Mattias Andrée (maandree@member.fsf.org) + * Copyright © 2014, 2015 Mattias Andrée (m@maandree.se) * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -19,26 +19,24 @@ #include "common.h" -#define X(A) const char* A = NULL; - LIST_ARGUMENTS +#define X(A) const char *A = NULL; +LIST_ARGUMENTS #undef X -int main(int argc, char** argv) +int +main(int argc, char **argv) { - int i; - - for (i = 1; i < argc; i++) - { -#define X(A) if (strstr(argv[i], "--" #A "=")) A = strchr(argv[i], '=') + 1; - LIST_ARGUMENTS + int i; + + for (i = 1; i < argc; i++) { +#define X(A) if (strstr(argv[i], "--" #A "=")) A = &strchr(argv[i], '=')[1]; + LIST_ARGUMENTS #undef X - } - - if (NULL == username) return 1; - if (NULL == ttyname) return 1; - if (NULL == pid) return 1; - - return -do_log(); -} + } + if (!username || !ttyname || !pid) + return 1; + + return -do_log(); +} -- cgit v1.2.3-70-g09d2