From: Frantisek Sumsal Date: Wed, 10 Jun 2020 17:45:33 +0000 (+0200) Subject: journal: drop the assert-only variable completely X-Git-Tag: v246-rc1~164^2~4 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=2b918da5a1773c612bf9e5715b2e538bf700f23c;p=thirdparty%2Fsystemd.git journal: drop the assert-only variable completely Followup to dfa64b64a7e2b9bffea260953b30e6236047fffb. --- 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 */