From b676171f863b9065a5703dc3208027febb2bb483 Mon Sep 17 00:00:00 2001 From: Sangbida Chaudhuri <101164840+sangbida@users.noreply.github.com> Date: Fri, 24 Oct 2025 13:57:51 +1030 Subject: [PATCH] hsm_secret: fixup! make read_line tidier --- common/hsm_secret.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/common/hsm_secret.c b/common/hsm_secret.c index 9acb044f1..bcb8cf4a0 100644 --- a/common/hsm_secret.c +++ b/common/hsm_secret.c @@ -415,8 +415,8 @@ static char *read_line(const tal_t *ctx) /* Strip newline */ size_t len = strlen(line); - if (len > 0 && line[len - 1] == '\n') - line[len - 1] = '\0'; + if (strends(line, "\n")) + len--; /* Convert to tal string */ char *result = tal_strndup(ctx, line, len);