summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2014-11-27 19:52:27 +0100
committerLennart Poettering <lennart@poettering.net>2014-11-27 22:05:24 +0100
commite09ca588d25a0c383880d6c2f5b129296af781ab (patch)
tree19ea117c84fbd35d50bdbe234d272c93cf08593a /src
parent086891e5c119abb9854237fc32e736fe2d67234c (diff)
log: be a bit less wasteful when allocating buffers
Diffstat (limited to 'src')
-rw-r--r--src/shared/log.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/shared/log.c b/src/shared/log.c
index ba959b914e..d87f43f5a4 100644
--- a/src/shared/log.c
+++ b/src/shared/log.c
@@ -366,7 +366,7 @@ static int write_to_syslog(
const char *object,
const char *buffer) {
- char header_priority[16], header_time[64], header_pid[16];
+ char header_priority[1 + DECIMAL_STR_MAX(int) + 2], header_time[64], header_pid[1 + DECIMAL_STR_MAX(pid_t) + 4];
struct iovec iovec[5] = {};
struct msghdr msghdr = {
.msg_iov = iovec,
@@ -429,7 +429,7 @@ static int write_to_kmsg(
const char *object,
const char *buffer) {
- char header_priority[16], header_pid[16];
+ char header_priority[1 + DECIMAL_STR_MAX(int) + 2], header_pid[1 + DECIMAL_STR_MAX(pid_t) + 4];
struct iovec iovec[5] = {};
if (kmsg_fd < 0)