From ffdd694f6050652d492606e5adbcb5f491050ace Mon Sep 17 00:00:00 2001 From: Ralph Corderoy Date: Wed, 19 Oct 2016 16:34:05 +0100 Subject: [PATCH] Fix ruserpass() to not assume `\n' present before trimming. --- sbr/ruserpass.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sbr/ruserpass.c b/sbr/ruserpass.c index bc24f520..de0f951b 100644 --- a/sbr/ruserpass.c +++ b/sbr/ruserpass.c @@ -148,7 +148,7 @@ ruserpass(char *host, char **aname, char **apass) if (fgets(tmp, sizeof(tmp) - 1, stdin) == NULL) { advise ("tmp", "fgets"); } - tmp[strlen(tmp) - 1] = '\0'; + TrimSuffixC(tmp, '\n'); if (*tmp != '\0' || myname == NULL) { myname = tmp; } -- 2.56.0