From: 2xsec Date: Sat, 14 Jul 2018 13:07:59 +0000 (+0900) Subject: tools: lxc-unshare: fix wrong coding rules X-Git-Tag: lxc-3.1.0~207^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=35bfea7ac7c84e61935e9c758674142ec3c7a326;p=thirdparty%2Flxc.git tools: lxc-unshare: fix wrong coding rules Signed-off-by: 2xsec --- diff --git a/src/lxc/tools/arguments.c b/src/lxc/tools/arguments.c index 30bb5dbb2..89af23c7f 100644 --- a/src/lxc/tools/arguments.c +++ b/src/lxc/tools/arguments.c @@ -338,4 +338,4 @@ bool lxc_setup_shared_ns(struct lxc_arguments *args, struct lxc_container *c) } return true; -} \ No newline at end of file +} diff --git a/src/lxc/tools/lxc_unshare.c b/src/lxc/tools/lxc_unshare.c index c1ec99611..501698c80 100644 --- a/src/lxc/tools/lxc_unshare.c +++ b/src/lxc/tools/lxc_unshare.c @@ -71,7 +71,7 @@ static int mount_fs(const char *source, const char *target, const char *type); static void lxc_setup_fs(void); static int do_start(void *arg); -static struct my_iflist *tmpif, *my_iflist = NULL; +static struct my_iflist *tmpif, *my_iflist; static const struct option my_longopts[] = { {"namespaces", required_argument, 0, 's'}, @@ -128,7 +128,8 @@ static int my_parser(struct lxc_arguments *args, int c, char *arg) args->want_hostname = arg; break; case 'i': - if (!(tmpif = malloc(sizeof(*tmpif)))) { + tmpif = malloc(sizeof(*tmpif)); + if (!tmpif) { SYSERROR("Failed to malloc()"); return -1; } @@ -327,7 +328,7 @@ int main(int argc, char *argv[]) exit(EXIT_FAILURE); } - if (*my_args.argv == NULL) { + if (!*my_args.argv) { ERROR("A command to execute in the new namespace is required"); exit(EXIT_FAILURE); } @@ -443,4 +444,4 @@ int main(int argc, char *argv[]) /* Call exit() directly on this function because it retuns an exit code. */ exit(EXIT_SUCCESS); -} \ No newline at end of file +}