From: Pierre Habouzit Date: Wed, 29 Aug 2007 21:10:23 +0000 (+0200) Subject: Strip whitespace for secrets X-Git-Url: http://git.madism.org/?p=apps%2Fpfixtools.git;a=commitdiff_plain;h=c97451fb3eab020454f0a55e5306123a994b2d6b Strip whitespace for secrets Signed-off-by: Pierre Habouzit --- 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) {