#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.68 2002/12/26 16:48:14 alex Exp $";
#include "imp.h"
#include <assert.h>
#ifdef SNIFFER
NGIRCd_Sniffer = FALSE;
#endif
- strcpy( NGIRCd_ConfFile, CONFIG_FILE );
+ strlcpy( NGIRCd_ConfFile, SYSCONFDIR, sizeof( NGIRCd_ConfFile ));
+ strlcat( NGIRCd_ConfFile, CONFIG_FILE, sizeof( NGIRCd_ConfFile ));
/* Kommandozeile parsen */
for( i = 1; i < argc; i++ )
{
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;
}
}
{
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;
}
strcat( txt, "IRCPLUS" );
#endif
- if( txt[0] ) strcat( txt, "-" );
- strcat( txt, TARGET_CPU );
- strcat( txt, "/" );
- strcat( txt, TARGET_VENDOR );
- strcat( txt, "/" );
- strcat( txt, TARGET_OS );
+ if( txt[0] ) strlcat( txt, "-", sizeof( txt ));
+ strlcat( txt, TARGET_CPU, sizeof( txt ));
+ strlcat( txt, "/", sizeof( txt ));
+ strlcat( txt, TARGET_VENDOR, sizeof( txt ));
+ strlcat( txt, "/", sizeof( txt ));
+ strlcat( txt, TARGET_OS, sizeof( txt ));
return txt;
} /* NGIRCd_VersionAddition */