summaryrefslogtreecommitdiff
path: root/readconf.c
diff options
context:
space:
mode:
Diffstat (limited to 'readconf.c')
-rw-r--r--readconf.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/readconf.c b/readconf.c
index 42a2961fa..9e15f27bb 100644
--- a/readconf.c
+++ b/readconf.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: readconf.c,v 1.232 2015/02/16 22:13:32 djm Exp $ */ 1/* $OpenBSD: readconf.c,v 1.233 2015/03/30 00:00:29 djm Exp $ */
2/* 2/*
3 * Author: Tatu Ylonen <ylo@cs.hut.fi> 3 * Author: Tatu Ylonen <ylo@cs.hut.fi>
4 * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland 4 * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -763,7 +763,9 @@ process_config_line(Options *options, struct passwd *pw, const char *host,
763 } 763 }
764 764
765 /* Strip trailing whitespace */ 765 /* Strip trailing whitespace */
766 for (len = strlen(line) - 1; len > 0; len--) { 766 if ((len = strlen(line)) == 0)
767 return 0;
768 for (len--; len > 0; len--) {
767 if (strchr(WHITESPACE, line[len]) == NULL) 769 if (strchr(WHITESPACE, line[len]) == NULL)
768 break; 770 break;
769 line[len] = '\0'; 771 line[len] = '\0';