X-Git-Url: https://arthur.barton.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fngircd%2Fngircd.c;h=92f1a3e2e131019dc960a58292d7f4da6530a2e4;hb=0ced4181b032249a5ccab2a6ae1d61bf08f60293;hp=20db13ed94c96a5bb2a4e02df2e398c5e37f3751;hpb=43a4bc5b8bb064e2dfca456ab6fcc656b4dfa813;p=ngircd.git diff --git a/src/ngircd/ngircd.c b/src/ngircd/ngircd.c index 20db13ed..92f1a3e2 100644 --- a/src/ngircd/ngircd.c +++ b/src/ngircd/ngircd.c @@ -14,7 +14,7 @@ #include "portab.h" -static char UNUSED id[] = "$Id: ngircd.c,v 1.65 2002/12/19 04:29:59 alex Exp $"; +static char UNUSED id[] = "$Id: ngircd.c,v 1.67 2002/12/26 16:25:43 alex Exp $"; #include "imp.h" #include @@ -73,7 +73,8 @@ main( int argc, const char *argv[] ) #ifdef SNIFFER NGIRCd_Sniffer = FALSE; #endif - strcpy( NGIRCd_ConfFile, CONFIG_FILE ); + strcpy( NGIRCd_ConfFile, SYSCONFDIR ); + strcat( NGIRCd_ConfFile, CONFIG_FILE ); /* Kommandozeile parsen */ for( i = 1; i < argc; i++ ) @@ -87,11 +88,10 @@ main( int argc, const char *argv[] ) { if( i + 1 < argc ) { - /* Ok, danach kommt noch ein Parameter */ - strncpy( NGIRCd_ConfFile, argv[i + 1], FNAME_LEN - 1 ); - NGIRCd_ConfFile[FNAME_LEN - 1] = '\0'; + /* Ok, there's an parameter left */ + strlcpy( NGIRCd_ConfFile, argv[i + 1], sizeof( NGIRCd_ConfFile )); - /* zum uebernaechsten Parameter */ + /* next parameter */ i++; ok = TRUE; } } @@ -154,11 +154,10 @@ main( int argc, const char *argv[] ) { if(( ! argv[i][n + 1] ) && ( i + 1 < argc )) { - /* Ok, danach kommt ein Leerzeichen */ - strncpy( NGIRCd_ConfFile, argv[i + 1], FNAME_LEN - 1 ); - NGIRCd_ConfFile[FNAME_LEN - 1] = '\0'; + /* Ok, next character is a blank */ + strlcpy( NGIRCd_ConfFile, argv[i + 1], sizeof( NGIRCd_ConfFile )); - /* zum uebernaechsten Parameter */ + /* go to the following parameter */ i++; n = (LONG)strlen( argv[i] ); ok = TRUE; }