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/basic/log.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/basic/log.c')
-rw-r--r-- | src/basic/log.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/src/basic/log.c b/src/basic/log.c index 5db65f276f..167f0f5533 100644 --- a/src/basic/log.c +++ b/src/basic/log.c @@ -1037,13 +1037,9 @@ int log_struct_iovec_internal( return -error; } - for (i = 0; i < n_input_iovec; i++) { - if (input_iovec[i].iov_len < STRLEN("MESSAGE=")) - continue; - - if (memcmp(input_iovec[i].iov_base, "MESSAGE=", STRLEN("MESSAGE=")) == 0) + for (i = 0; i < n_input_iovec; i++) + if (memory_startswith(input_iovec[i].iov_base, input_iovec[i].iov_len, "MESSAGE=")) break; - } if (_unlikely_(i >= n_input_iovec)) /* Couldn't find MESSAGE=? */ return -error; |