From 2b918da5a1773c612bf9e5715b2e538bf700f23c Mon Sep 17 00:00:00 2001 From: Frantisek Sumsal Date: Wed, 10 Jun 2020 19:45:33 +0200 Subject: [PATCH] journal: drop the assert-only variable completely Followup to dfa64b64a7e2b9bffea260953b30e6236047fffb. --- src/journal/journal-send.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/journal/journal-send.c b/src/journal/journal-send.c index 57d09e78c38..d51d03acd9d 100644 --- a/src/journal/journal-send.c +++ b/src/journal/journal-send.c @@ -96,11 +96,9 @@ _public_ int sd_journal_printv(int priority, const char *format, va_list ap) { /* Allocate large buffer to accommodate big message */ if (len >= LINE_MAX) { - _unused_ int rlen; buffer = alloca(len + 9); memcpy(buffer, "MESSAGE=", 8); - rlen = vsnprintf(buffer + 8, len + 1, format, ap); - assert(len == rlen); + assert_se(vsnprintf(buffer + 8, len + 1, format, ap) == len); } /* Strip trailing whitespace, keep prefix whitespace. */ @@ -474,11 +472,9 @@ _public_ int sd_journal_printv_with_location(int priority, const char *file, con /* Allocate large buffer to accommodate big message */ if (len >= LINE_MAX) { - _unused_ int rlen; buffer = alloca(len + 9); memcpy(buffer, "MESSAGE=", 8); - rlen = vsnprintf(buffer + 8, len + 1, format, ap); - assert(len == rlen); + assert_se(vsnprintf(buffer + 8, len + 1, format, ap) == len); } /* Strip trailing whitespace, keep prefixing whitespace */ -- 2.47.3