]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
journalctl: minor follow-up for --lines=
authorMike Yuan <me@yhndnzj.com>
Wed, 16 Aug 2023 12:35:15 +0000 (20:35 +0800)
committerLuca Boccassi <luca.boccassi@gmail.com>
Wed, 16 Aug 2023 15:23:35 +0000 (16:23 +0100)
Follow-up for 8d6791d2aa98c989101f572278e9b0a63edfec42

Addresses https://github.com/systemd/systemd/pull/28777#discussion_r1295790102

src/journal/journalctl.c

index a4e34fa0b12ab16615f3f6681d9e0287eb993882..f1c19af1b26229a92fdd0bab8cdbdb2e900e814f 100644 (file)
@@ -95,7 +95,7 @@ static bool arg_full = true;
 static bool arg_all = false;
 static PagerFlags arg_pager_flags = 0;
 static int arg_lines = ARG_LINES_DEFAULT;
-static int arg_lines_oldest = false;
+static bool arg_lines_oldest = false;
 static bool arg_no_tail = false;
 static bool arg_truncate_newline = false;
 static bool arg_quiet = false;
@@ -631,7 +631,7 @@ static int parse_argv(int argc, char *argv[]) {
                         break;
 
                 case 'n':
-                        r = parse_lines(optarg ?: optind < argc ? argv[optind] : NULL, !optarg);
+                        r = parse_lines(optarg ?: argv[optind], !optarg);
                         if (r < 0)
                                 return r;
                         if (r > 0 && !optarg)