From 6d631a50b61036912683003bc53d92be05576630 Mon Sep 17 00:00:00 2001 From: Ralph Corderoy Date: Wed, 19 Oct 2016 10:03:31 +0100 Subject: [PATCH] Replace strchr() condition with TrimSuffixC(). --- uip/mhlogin.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/uip/mhlogin.c b/uip/mhlogin.c index d6dd0afd..ffa44f3f 100644 --- a/uip/mhlogin.c +++ b/uip/mhlogin.c @@ -36,13 +36,12 @@ DEFINE_SWITCH_ARRAY(MHLOGIN, switches); static char * geta (void) { - char *cp; static char line[BUFSIZ]; if (fgets(line, sizeof(line), stdin) == NULL) done (1); - if ((cp = strchr(line, '\n'))) - *cp = 0; + TrimSuffixC(line, '\n'); + return line; } -- 2.56.0