diff options
author | Lennart Poettering <lennart@poettering.net> | 2018-05-30 13:09:03 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2018-05-30 13:11:51 +0200 |
commit | d27b725abf64a19a6b2f99332b663f17ad046771 (patch) | |
tree | 8123319f18a5c059f30bdda7f14e12665e585d53 /src/shared/logs-show.c | |
parent | string-util: add new memory_startswith() helper (diff) | |
download | systemd-d27b725abf64a19a6b2f99332b663f17ad046771.tar.xz systemd-d27b725abf64a19a6b2f99332b663f17ad046771.zip |
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.c | 9 |
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); |