mirror of
https://github.com/systemd/systemd.git
synced 2025-02-04 21:47:31 +03:00
journal: drop the assert-only variable completely
Followup to dfa64b64a7e2b9bffea260953b30e6236047fffb.
This commit is contained in:
parent
5a573f2b91
commit
2b918da5a1
@ -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 */
|
||||
|
Loading…
x
Reference in New Issue
Block a user