From: Adam Sutton Date: Sat, 9 Feb 2013 12:48:57 +0000 (+0000) Subject: main: fix possible NULL ptr on startup X-Git-Tag: v3.5~12 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=74c9b4ecb1de1aee63be409e1ef7283aed38371a;p=thirdparty%2Ftvheadend.git main: fix possible NULL ptr on startup --- diff --git a/src/main.c b/src/main.c index be27a602e..a9a506513 100644 --- a/src/main.c +++ b/src/main.c @@ -514,7 +514,7 @@ main(int argc, char **argv) gid_t gid; uid_t uid; struct group *grp = getgrnam(opt_group ?: "video"); - struct passwd *pw = getpwnam(opt_user) ?: NULL; + struct passwd *pw = opt_user ? getpwnam(opt_user) : NULL; FILE *pidfile = fopen(opt_pidpath, "w+"); if(grp != NULL) {