From adefff2667c7a953cc62ee6ec34c55c9fe714340 Mon Sep 17 00:00:00 2001 From: Michael Grant Date: Sat, 4 Jul 2026 13:35:16 +0100 Subject: [PATCH] Make if clearer. --- layout-custom.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/layout-custom.c b/layout-custom.c index f801108ec..7921dbcfc 100644 --- a/layout-custom.c +++ b/layout-custom.c @@ -850,8 +850,11 @@ layout_prepare(struct window *w, const char *layout, char **cause) ctx.cells = 0; has_checksum = layout_parse_checksum(&ctx, &csum); body = ctx.ptr; - if ((has_checksum && csum != layout_checksum(body, ctx.end)) || - layout_construct(&ctx, NULL, &root) != 0) { + if (has_checksum && csum != layout_checksum(body, ctx.end)) { + *cause = xstrdup("invalid layout checksum"); + return (NULL); + } + if (layout_construct(&ctx, NULL, &root) != 0) { *cause = xstrdup("invalid layout"); layout_free_cell(root); return (NULL);