From c97451fb3eab020454f0a55e5306123a994b2d6b Mon Sep 17 00:00:00 2001 From: Pierre Habouzit Date: Wed, 29 Aug 2007 23:10:23 +0200 Subject: [PATCH] Strip whitespace for secrets Signed-off-by: Pierre Habouzit --- srsd.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/srsd.c b/srsd.c index 0ee15ca..cd53c9e 100644 --- a/srsd.c +++ b/srsd.c @@ -349,12 +349,12 @@ static srs_t *srs_read_secrets(const char *sfile) int n = strlen(buf); ++lineno; - if (buf[n - 1] != '\n') { + if (n == sizeof(buf) - 1 && buf[n - 1] != '\n') { syslog(LOG_CRIT, "%s:%d: line too long", sfile, lineno); goto error; } - - srs_add_secret(srs, buf); + m_strrtrim(buf); + srs_add_secret(srs, skipspaces(buf)); } if (!lineno) { -- 2.20.1