From f25b7c27ffaa8cd7b18839c880cf31c0272f8495 Mon Sep 17 00:00:00 2001 From: "Dmitry V. Levin" Date: Tue, 30 Jun 2020 08:00:00 +0000 Subject: misc_conv: remove redundant check * libpam_misc/misc_conv.c (read_string): Remove redundant nc > 0 check as it has already been tested in the previous condition. --- libpam_misc/misc_conv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'libpam_misc/misc_conv.c') diff --git a/libpam_misc/misc_conv.c b/libpam_misc/misc_conv.c index f6397af1..cabe2dad 100644 --- a/libpam_misc/misc_conv.c +++ b/libpam_misc/misc_conv.c @@ -202,7 +202,7 @@ static int read_string(int echo, const char *prompt, char **retstr) } else if (nc > 0) { /* we got some user input */ D(("we got some user input")); - if (nc > 0 && line[nc-1] == '\n') { /* terminate */ + if (line[nc-1] == '\n') { /* terminate */ line[--nc] = '\0'; } else { if (echo) { -- cgit v1.2.1