From: Zbigniew Jędrzejewski-Szmek Date: Fri, 8 Dec 2023 08:56:43 +0000 (+0100) Subject: bsod: do not use STRLEN X-Git-Tag: v256-rc1~1015^2~5 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=e1054a8bcd7ed3f29bc8ea72fd703760d3852392;p=thirdparty%2Fsystemd.git bsod: do not use STRLEN The compiler optimizes strlen away, so we can use the simplest form that is type safe and more natural. STRLEN is only for array initialization. --- diff --git a/src/journal/bsod.c b/src/journal/bsod.c index a88cb66b81d..059e255ea46 100644 --- a/src/journal/bsod.c +++ b/src/journal/bsod.c @@ -103,7 +103,7 @@ static int acquire_first_emergency_log_message(char **ret) { if (r < 0) return log_error_errno(r, "Failed to read journal message: %m"); - message = memdup_suffix0((const char*)d + STRLEN("MESSAGE="), l - STRLEN("MESSAGE=")); + message = memdup_suffix0((const char*)d + strlen("MESSAGE="), l - strlen("MESSAGE=")); if (!message) return log_oom();