summaryrefslogtreecommitdiff
path: root/src/journal/journal-send.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/journal/journal-send.c')
-rw-r--r--src/journal/journal-send.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/journal/journal-send.c b/src/journal/journal-send.c
index 4acef26394..a78aa07032 100644
--- a/src/journal/journal-send.c
+++ b/src/journal/journal-send.c
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: LGPL-2.1+ */
/***
This file is part of systemd.
@@ -95,7 +96,7 @@ _public_ int sd_journal_printv(int priority, const char *format, va_list ap) {
/* FIXME: Instead of limiting things to LINE_MAX we could do a
C99 variable-length array on the stack here in a loop. */
- char buffer[8 + LINE_MAX], p[sizeof("PRIORITY=")-1 + DECIMAL_STR_MAX(int) + 1];
+ char buffer[8 + LINE_MAX], p[STRLEN("PRIORITY=") + DECIMAL_STR_MAX(int) + 1];
struct iovec iov[2];
assert_return(priority >= 0, -EINVAL);
@@ -356,7 +357,7 @@ static int fill_iovec_perror_and_send(const char *message, int skip, struct iove
errno = 0;
j = strerror_r(_saved_errno_, buffer + 8 + k, n - 8 - k);
if (errno == 0) {
- char error[sizeof("ERRNO=")-1 + DECIMAL_STR_MAX(int) + 1];
+ char error[STRLEN("ERRNO=") + DECIMAL_STR_MAX(int) + 1];
if (j != buffer + 8 + k)
memmove(buffer + 8 + k, j, strlen(j)+1);
@@ -458,7 +459,7 @@ _public_ int sd_journal_print_with_location(int priority, const char *file, cons
}
_public_ int sd_journal_printv_with_location(int priority, const char *file, const char *line, const char *func, const char *format, va_list ap) {
- char buffer[8 + LINE_MAX], p[sizeof("PRIORITY=")-1 + DECIMAL_STR_MAX(int) + 1];
+ char buffer[8 + LINE_MAX], p[STRLEN("PRIORITY=") + DECIMAL_STR_MAX(int) + 1];
struct iovec iov[5];
char *f;