diff --git a/sm5/smartd.c b/sm5/smartd.c index 1e041e38b03e25ede8d84f055c618a3aa6495877..6680421c6028bd51dcc4d2b0e32e412cb3b10a2c 100644 --- a/sm5/smartd.c +++ b/sm5/smartd.c @@ -39,7 +39,7 @@ // CVS ID strings extern const char *CVSid1, *CVSid2; -const char *CVSid3="$Id: smartd.c,v 1.33 2002/10/26 09:38:26 ballen4705 Exp $" +const char *CVSid3="$Id: smartd.c,v 1.34 2002/10/26 09:58:05 ballen4705 Exp $" CVSID1 CVSID4 CVSID7; // This function prints either to stdout or to the syslog as needed @@ -509,8 +509,13 @@ int parseconfigfile(){ // See if line is too long len=strlen(line); if (len>MAXLINELEN){ - printout(LOG_CRIT,"Error: line %d of file %s is more than than %d characters long.\n", - lineno,CONFIGFILE,MAXLINELEN); + char *warn; + if (line[len-1]=='\n') + warn="(including newline!) "; + else + warn=""; + printout(LOG_CRIT,"Error: line %d of file %s %sis more than than %d characters long.\n", + lineno,CONFIGFILE,warn,MAXLINELEN); exit(1); } diff --git a/sm5/smartd.cpp b/sm5/smartd.cpp index 5651802da141ff22144bc48737160ac22ede8233..c9b16d763ce63dcf3b3fae989684a397ee4c0f90 100644 --- a/sm5/smartd.cpp +++ b/sm5/smartd.cpp @@ -39,7 +39,7 @@ // CVS ID strings extern const char *CVSid1, *CVSid2; -const char *CVSid3="$Id: smartd.cpp,v 1.33 2002/10/26 09:38:26 ballen4705 Exp $" +const char *CVSid3="$Id: smartd.cpp,v 1.34 2002/10/26 09:58:05 ballen4705 Exp $" CVSID1 CVSID4 CVSID7; // This function prints either to stdout or to the syslog as needed @@ -509,8 +509,13 @@ int parseconfigfile(){ // See if line is too long len=strlen(line); if (len>MAXLINELEN){ - printout(LOG_CRIT,"Error: line %d of file %s is more than than %d characters long.\n", - lineno,CONFIGFILE,MAXLINELEN); + char *warn; + if (line[len-1]=='\n') + warn="(including newline!) "; + else + warn=""; + printout(LOG_CRIT,"Error: line %d of file %s %sis more than than %d characters long.\n", + lineno,CONFIGFILE,warn,MAXLINELEN); exit(1); }