summaryrefslogtreecommitdiff
path: root/src/shared/logs-show.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2018-05-30 13:09:03 +0200
committerLennart Poettering <lennart@poettering.net>2018-05-30 13:11:51 +0200
commitd27b725abf64a19a6b2f99332b663f17ad046771 (patch)
tree8123319f18a5c059f30bdda7f14e12665e585d53 /src/shared/logs-show.c
parent9b8ff18319965c7e599a70c2a1fab65823b53536 (diff)
downloadsystemd-d27b725abf64a19a6b2f99332b663f17ad046771.tar.gz
tree-wide: make use of memory_startswith() at various places
Diffstat (limited to 'src/shared/logs-show.c')
-rw-r--r--src/shared/logs-show.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/shared/logs-show.c b/src/shared/logs-show.c
index 47becbf37c..af788391ad 100644
--- a/src/shared/logs-show.c
+++ b/src/shared/logs-show.c
@@ -832,8 +832,7 @@ static int output_json(
char *n;
unsigned u;
- if (length >= 9 &&
- memcmp(data, "_BOOT_ID=", 9) == 0)
+ if (memory_startswith(data, length, "_BOOT_ID="))
continue;
eq = memchr(data, '=', length);
@@ -882,10 +881,8 @@ static int output_json(
size_t m;
unsigned u;
- /* We already printed the boot id, from the data in
- * the header, hence let's suppress it here */
- if (length >= 9 &&
- memcmp(data, "_BOOT_ID=", 9) == 0)
+ /* We already printed the boot id, from the data in the header, hence let's suppress it here */
+ if (memory_startswith(data, length, "_BOOT_ID="))
continue;
eq = memchr(data, '=', length);