Skip to content

Commit b676171

Browse files
sangbidarustyrussell
authored andcommitted
hsm_secret: fixup! make read_line tidier
1 parent a289cd4 commit b676171

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

common/hsm_secret.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -415,8 +415,8 @@ static char *read_line(const tal_t *ctx)
415415

416416
/* Strip newline */
417417
size_t len = strlen(line);
418-
if (len > 0 && line[len - 1] == '\n')
419-
line[len - 1] = '\0';
418+
if (strends(line, "\n"))
419+
len--;
420420

421421
/* Convert to tal string */
422422
char *result = tal_strndup(ctx, line, len);

0 commit comments

Comments
 (0)