mirror of
https://github.com/osmarks/ngircd.git
synced 2024-12-15 03:10:27 +00:00
- einige Anpassungen nach Code-Check mit SPLint ;-)
This commit is contained in:
parent
c0ef984273
commit
95a4b1b158
@ -9,7 +9,7 @@
|
|||||||
* Naehere Informationen entnehmen Sie bitter der Datei COPYING. Eine Liste
|
* Naehere Informationen entnehmen Sie bitter der Datei COPYING. Eine Liste
|
||||||
* der an ngIRCd beteiligten Autoren finden Sie in der Datei AUTHORS.
|
* der an ngIRCd beteiligten Autoren finden Sie in der Datei AUTHORS.
|
||||||
*
|
*
|
||||||
* $Id: channel.h,v 1.15 2002/03/25 16:55:14 alex Exp $
|
* $Id: channel.h,v 1.16 2002/03/25 19:11:01 alex Exp $
|
||||||
*
|
*
|
||||||
* channel.h: Management der Channels (Header)
|
* channel.h: Management der Channels (Header)
|
||||||
*/
|
*/
|
||||||
@ -21,7 +21,7 @@
|
|||||||
#include "client.h"
|
#include "client.h"
|
||||||
|
|
||||||
|
|
||||||
#ifdef __channel_c__
|
#if defined(__channel_c__) | defined(S_SPLINT_S)
|
||||||
|
|
||||||
#include "defines.h"
|
#include "defines.h"
|
||||||
|
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
* Naehere Informationen entnehmen Sie bitter der Datei COPYING. Eine Liste
|
* Naehere Informationen entnehmen Sie bitter der Datei COPYING. Eine Liste
|
||||||
* der an ngIRCd beteiligten Autoren finden Sie in der Datei AUTHORS.
|
* der an ngIRCd beteiligten Autoren finden Sie in der Datei AUTHORS.
|
||||||
*
|
*
|
||||||
* $Id: client.c,v 1.51 2002/03/25 16:59:36 alex Exp $
|
* $Id: client.c,v 1.52 2002/03/25 19:11:01 alex Exp $
|
||||||
*
|
*
|
||||||
* client.c: Management aller Clients
|
* client.c: Management aller Clients
|
||||||
*
|
*
|
||||||
@ -105,7 +105,7 @@ GLOBAL VOID Client_Exit( VOID )
|
|||||||
while( c )
|
while( c )
|
||||||
{
|
{
|
||||||
cnt++;
|
cnt++;
|
||||||
next = c->next;
|
next = (CLIENT *)c->next;
|
||||||
free( c );
|
free( c );
|
||||||
c = next;
|
c = next;
|
||||||
}
|
}
|
||||||
@ -169,7 +169,7 @@ GLOBAL CLIENT *Client_New( CONN_ID Idx, CLIENT *Introducer, CLIENT *TopServer, I
|
|||||||
if( strchr( client->modes, 'a' )) strcpy( client->away, DEFAULT_AWAY_MSG );
|
if( strchr( client->modes, 'a' )) strcpy( client->away, DEFAULT_AWAY_MSG );
|
||||||
|
|
||||||
/* Verketten */
|
/* Verketten */
|
||||||
client->next = My_Clients;
|
client->next = (POINTER *)My_Clients;
|
||||||
My_Clients = client;
|
My_Clients = client;
|
||||||
|
|
||||||
return client;
|
return client;
|
||||||
@ -209,7 +209,7 @@ GLOBAL VOID Client_Destroy( CLIENT *Client, CHAR *LogMsg, CHAR *FwdMsg, BOOLEAN
|
|||||||
{
|
{
|
||||||
/* Wir haben den Client gefunden: entfernen */
|
/* Wir haben den Client gefunden: entfernen */
|
||||||
if( last ) last->next = c->next;
|
if( last ) last->next = c->next;
|
||||||
else My_Clients = c->next;
|
else My_Clients = (CLIENT *)c->next;
|
||||||
|
|
||||||
if( c->type == CLIENT_USER )
|
if( c->type == CLIENT_USER )
|
||||||
{
|
{
|
||||||
@ -274,7 +274,7 @@ GLOBAL VOID Client_Destroy( CLIENT *Client, CHAR *LogMsg, CHAR *FwdMsg, BOOLEAN
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
last = c;
|
last = c;
|
||||||
c = c->next;
|
c = (CLIENT *)c->next;
|
||||||
}
|
}
|
||||||
} /* Client_Destroy */
|
} /* Client_Destroy */
|
||||||
|
|
||||||
@ -478,7 +478,7 @@ GLOBAL CLIENT *Client_GetFromConn( CONN_ID Idx )
|
|||||||
while( c )
|
while( c )
|
||||||
{
|
{
|
||||||
if( c->conn_id == Idx ) return c;
|
if( c->conn_id == Idx ) return c;
|
||||||
c = c->next;
|
c = (CLIENT *)c->next;
|
||||||
}
|
}
|
||||||
return NULL;
|
return NULL;
|
||||||
} /* Client_GetFromConn */
|
} /* Client_GetFromConn */
|
||||||
@ -511,7 +511,7 @@ GLOBAL CLIENT *Client_Search( CHAR *Nick )
|
|||||||
/* lt. Hash-Wert: Treffer! */
|
/* lt. Hash-Wert: Treffer! */
|
||||||
if( strcasecmp( c->id, search_id ) == 0 ) return c;
|
if( strcasecmp( c->id, search_id ) == 0 ) return c;
|
||||||
}
|
}
|
||||||
c = c->next;
|
c = (CLIENT *)c->next;
|
||||||
}
|
}
|
||||||
return NULL;
|
return NULL;
|
||||||
} /* Client_Search */
|
} /* Client_Search */
|
||||||
@ -532,7 +532,7 @@ GLOBAL CLIENT *Client_GetFromToken( CLIENT *Client, INT Token )
|
|||||||
while( c )
|
while( c )
|
||||||
{
|
{
|
||||||
if(( c->type == CLIENT_SERVER ) && ( c->introducer == Client ) && ( c->token == Token )) return c;
|
if(( c->type == CLIENT_SERVER ) && ( c->introducer == Client ) && ( c->token == Token )) return c;
|
||||||
c = c->next;
|
c = (CLIENT *)c->next;
|
||||||
}
|
}
|
||||||
return NULL;
|
return NULL;
|
||||||
} /* Client_GetFromToken */
|
} /* Client_GetFromToken */
|
||||||
@ -575,7 +575,7 @@ GLOBAL CHAR *Client_Info( CLIENT *Client )
|
|||||||
GLOBAL CHAR *Client_User( CLIENT *Client )
|
GLOBAL CHAR *Client_User( CLIENT *Client )
|
||||||
{
|
{
|
||||||
assert( Client != NULL );
|
assert( Client != NULL );
|
||||||
if( Client->user ) return Client->user;
|
if( Client->user[0] ) return Client->user;
|
||||||
else return "~";
|
else return "~";
|
||||||
} /* Client_User */
|
} /* Client_User */
|
||||||
|
|
||||||
@ -741,7 +741,7 @@ GLOBAL BOOLEAN Client_CheckID( CLIENT *Client, CHAR *ID )
|
|||||||
Conn_Close( Client->conn_id, str, str, TRUE );
|
Conn_Close( Client->conn_id, str, str, TRUE );
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
c = c->next;
|
c = (CLIENT *)c->next;
|
||||||
}
|
}
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
@ -762,7 +762,7 @@ GLOBAL CLIENT *Client_Next( CLIENT *c )
|
|||||||
* so wird NULL geliefert. */
|
* so wird NULL geliefert. */
|
||||||
|
|
||||||
assert( c != NULL );
|
assert( c != NULL );
|
||||||
return c->next;
|
return (CLIENT *)c->next;
|
||||||
} /* Client_Next */
|
} /* Client_Next */
|
||||||
|
|
||||||
|
|
||||||
@ -812,7 +812,7 @@ GLOBAL INT Client_OperCount( VOID )
|
|||||||
while( c )
|
while( c )
|
||||||
{
|
{
|
||||||
if( c && ( c->type == CLIENT_USER ) && ( strchr( c->modes, 'o' ))) cnt++;
|
if( c && ( c->type == CLIENT_USER ) && ( strchr( c->modes, 'o' ))) cnt++;
|
||||||
c = c->next;
|
c = (CLIENT *)c->next;
|
||||||
}
|
}
|
||||||
return cnt;
|
return cnt;
|
||||||
} /* Client_OperCount */
|
} /* Client_OperCount */
|
||||||
@ -828,7 +828,7 @@ GLOBAL INT Client_UnknownCount( VOID )
|
|||||||
while( c )
|
while( c )
|
||||||
{
|
{
|
||||||
if( c && ( c->type != CLIENT_USER ) && ( c->type != CLIENT_SERVICE ) && ( c->type != CLIENT_SERVER )) cnt++;
|
if( c && ( c->type != CLIENT_USER ) && ( c->type != CLIENT_SERVICE ) && ( c->type != CLIENT_SERVER )) cnt++;
|
||||||
c = c->next;
|
c = (CLIENT *)c->next;
|
||||||
}
|
}
|
||||||
return cnt;
|
return cnt;
|
||||||
} /* Client_UnknownCount */
|
} /* Client_UnknownCount */
|
||||||
@ -868,7 +868,7 @@ LOCAL INT Count( CLIENT_TYPE Type )
|
|||||||
while( c )
|
while( c )
|
||||||
{
|
{
|
||||||
if( c && ( c->type == Type )) cnt++;
|
if( c && ( c->type == Type )) cnt++;
|
||||||
c = c->next;
|
c = (CLIENT *)c->next;
|
||||||
}
|
}
|
||||||
return cnt;
|
return cnt;
|
||||||
} /* Count */
|
} /* Count */
|
||||||
@ -884,7 +884,7 @@ LOCAL INT MyCount( CLIENT_TYPE Type )
|
|||||||
while( c )
|
while( c )
|
||||||
{
|
{
|
||||||
if( c && ( c->introducer == This_Server ) && ( c->type == Type )) cnt++;
|
if( c && ( c->introducer == This_Server ) && ( c->type == Type )) cnt++;
|
||||||
c = c->next;
|
c = (CLIENT *)c->next;
|
||||||
}
|
}
|
||||||
return cnt;
|
return cnt;
|
||||||
} /* MyCount */
|
} /* MyCount */
|
||||||
@ -941,7 +941,7 @@ LOCAL VOID Generate_MyToken( CLIENT *Client )
|
|||||||
c = My_Clients;
|
c = My_Clients;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
else c = c->next;
|
else c = (CLIENT *)c->next;
|
||||||
}
|
}
|
||||||
Client->mytoken = token;
|
Client->mytoken = token;
|
||||||
Log( LOG_DEBUG, "Assigned token %d to server \"%s\".", token, Client->id );
|
Log( LOG_DEBUG, "Assigned token %d to server \"%s\".", token, Client->id );
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
* Naehere Informationen entnehmen Sie bitter der Datei COPYING. Eine Liste
|
* Naehere Informationen entnehmen Sie bitter der Datei COPYING. Eine Liste
|
||||||
* der an ngIRCd beteiligten Autoren finden Sie in der Datei AUTHORS.
|
* der an ngIRCd beteiligten Autoren finden Sie in der Datei AUTHORS.
|
||||||
*
|
*
|
||||||
* $Id: client.h,v 1.26 2002/03/25 17:01:07 alex Exp $
|
* $Id: client.h,v 1.27 2002/03/25 19:11:01 alex Exp $
|
||||||
*
|
*
|
||||||
* client.h: Konfiguration des ngircd (Header)
|
* client.h: Konfiguration des ngircd (Header)
|
||||||
*/
|
*/
|
||||||
@ -35,7 +35,7 @@ typedef enum
|
|||||||
} CLIENT_TYPE;
|
} CLIENT_TYPE;
|
||||||
|
|
||||||
|
|
||||||
#ifdef __client_c__
|
#if defined(__client_c__) | defined(S_SPLINT_S)
|
||||||
|
|
||||||
#include "defines.h"
|
#include "defines.h"
|
||||||
|
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
* Naehere Informationen entnehmen Sie bitter der Datei COPYING. Eine Liste
|
* Naehere Informationen entnehmen Sie bitter der Datei COPYING. Eine Liste
|
||||||
* der an ngIRCd beteiligten Autoren finden Sie in der Datei AUTHORS.
|
* der an ngIRCd beteiligten Autoren finden Sie in der Datei AUTHORS.
|
||||||
*
|
*
|
||||||
* $Id: conf.c,v 1.19 2002/03/25 16:14:15 alex Exp $
|
* $Id: conf.c,v 1.20 2002/03/25 19:11:01 alex Exp $
|
||||||
*
|
*
|
||||||
* conf.h: Konfiguration des ngircd
|
* conf.h: Konfiguration des ngircd
|
||||||
*/
|
*/
|
||||||
@ -170,7 +170,7 @@ LOCAL VOID Read_Config( VOID )
|
|||||||
GLOBAL VOID Handle_GLOBAL( INT Line, CHAR *Var, CHAR *Arg )
|
GLOBAL VOID Handle_GLOBAL( INT Line, CHAR *Var, CHAR *Arg )
|
||||||
{
|
{
|
||||||
CHAR *ptr;
|
CHAR *ptr;
|
||||||
INT port;
|
INT32 port;
|
||||||
|
|
||||||
assert( Line > 0 );
|
assert( Line > 0 );
|
||||||
assert( Var != NULL );
|
assert( Var != NULL );
|
||||||
@ -209,7 +209,7 @@ GLOBAL VOID Handle_GLOBAL( INT Line, CHAR *Var, CHAR *Arg )
|
|||||||
if( Conf_ListenPorts_Count + 1 > MAX_LISTEN_PORTS ) Log( LOG_ERR, "Too many listen ports configured. Port %ld ignored.", port );
|
if( Conf_ListenPorts_Count + 1 > MAX_LISTEN_PORTS ) Log( LOG_ERR, "Too many listen ports configured. Port %ld ignored.", port );
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if( port > 0 && port < 0xFFFF ) Conf_ListenPorts[Conf_ListenPorts_Count++] = port;
|
if( port > 0 && port < 0xFFFF ) Conf_ListenPorts[Conf_ListenPorts_Count++] = (INT)port;
|
||||||
else Log( LOG_ERR, "%s, line %d (section \"Global\"): Illegal port number %ld!", Conf_File, Line, port );
|
else Log( LOG_ERR, "%s, line %d (section \"Global\"): Illegal port number %ld!", Conf_File, Line, port );
|
||||||
}
|
}
|
||||||
ptr = strtok( NULL, "," );
|
ptr = strtok( NULL, "," );
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
* Naehere Informationen entnehmen Sie bitter der Datei COPYING. Eine Liste
|
* Naehere Informationen entnehmen Sie bitter der Datei COPYING. Eine Liste
|
||||||
* der an ngIRCd beteiligten Autoren finden Sie in der Datei AUTHORS.
|
* der an ngIRCd beteiligten Autoren finden Sie in der Datei AUTHORS.
|
||||||
*
|
*
|
||||||
* $Id: hash.c,v 1.3 2002/03/22 00:21:51 alex Exp $
|
* $Id: hash.c,v 1.4 2002/03/25 19:11:01 alex Exp $
|
||||||
*
|
*
|
||||||
* hash.c: Hash-Werte berechnen
|
* hash.c: Hash-Werte berechnen
|
||||||
*/
|
*/
|
||||||
@ -41,7 +41,7 @@ GLOBAL UINT32 Hash( CHAR *String )
|
|||||||
strncpy( buffer, String, LINE_LEN - 1 );
|
strncpy( buffer, String, LINE_LEN - 1 );
|
||||||
buffer[LINE_LEN - 1] = '\0';
|
buffer[LINE_LEN - 1] = '\0';
|
||||||
|
|
||||||
return jenkins_hash( ngt_LowerStr( buffer ), strlen( buffer ), 42 );
|
return jenkins_hash( (UINT8 *)ngt_LowerStr( buffer ), strlen( buffer ), 42 );
|
||||||
} /* Hash */
|
} /* Hash */
|
||||||
|
|
||||||
|
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
* Naehere Informationen entnehmen Sie bitter der Datei COPYING. Eine Liste
|
* Naehere Informationen entnehmen Sie bitter der Datei COPYING. Eine Liste
|
||||||
* der an ngIRCd beteiligten Autoren finden Sie in der Datei AUTHORS.
|
* der an ngIRCd beteiligten Autoren finden Sie in der Datei AUTHORS.
|
||||||
*
|
*
|
||||||
* $Id: log.c,v 1.22 2002/03/21 12:00:23 alex Exp $
|
* $Id: log.c,v 1.23 2002/03/25 19:11:01 alex Exp $
|
||||||
*
|
*
|
||||||
* log.c: Logging-Funktionen
|
* log.c: Logging-Funktionen
|
||||||
*/
|
*/
|
||||||
@ -85,7 +85,7 @@ GLOBAL VOID Log_Init( VOID )
|
|||||||
if( ! freopen( ERROR_FILE, "a+", stderr )) Log( LOG_ERR, "Can't reopen stderr (\""ERROR_FILE"\"): %s", strerror( errno ));
|
if( ! freopen( ERROR_FILE, "a+", stderr )) Log( LOG_ERR, "Can't reopen stderr (\""ERROR_FILE"\"): %s", strerror( errno ));
|
||||||
|
|
||||||
fprintf( stderr, "\n--- %s ---\n\n", NGIRCd_StartStr );
|
fprintf( stderr, "\n--- %s ---\n\n", NGIRCd_StartStr );
|
||||||
fprintf( stderr, "%s started.\npid=%d, ppid=%d, uid=%d, gid=%d [euid=%d, egid=%d].\nActivating: %s\n\n", NGIRCd_Version( ), getpid( ), getppid( ), getuid( ), getgid( ), geteuid( ), getegid( ), txt[0] ? txt : "-" );
|
fprintf( stderr, "%s started.\npid=%ld, ppid=%ld, uid=%ld, gid=%ld [euid=%ld, egid=%ld].\nActivating: %s\n\n", NGIRCd_Version( ), (INT32)getpid( ), (INT32)getppid( ), (INT32)getuid( ), (INT32)getgid( ), (INT32)geteuid( ), (INT32)getegid( ), txt[0] ? txt : "-" );
|
||||||
fflush( stderr );
|
fflush( stderr );
|
||||||
} /* Log_Init */
|
} /* Log_Init */
|
||||||
|
|
||||||
@ -99,7 +99,7 @@ GLOBAL VOID Log_Exit( VOID )
|
|||||||
|
|
||||||
t = time( NULL );
|
t = time( NULL );
|
||||||
fputs( ctime( &t ), stderr );
|
fputs( ctime( &t ), stderr );
|
||||||
fprintf( stderr, PACKAGE" done (pid=%d).\n", getpid( ));
|
fprintf( stderr, PACKAGE" done (pid=%ld).\n", (INT32)getpid( ));
|
||||||
fflush( stderr );
|
fflush( stderr );
|
||||||
|
|
||||||
#ifdef USE_SYSLOG
|
#ifdef USE_SYSLOG
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
* Naehere Informationen entnehmen Sie bitter der Datei COPYING. Eine Liste
|
* Naehere Informationen entnehmen Sie bitter der Datei COPYING. Eine Liste
|
||||||
* der an ngIRCd beteiligten Autoren finden Sie in der Datei AUTHORS.
|
* der an ngIRCd beteiligten Autoren finden Sie in der Datei AUTHORS.
|
||||||
*
|
*
|
||||||
* $Id: ngircd.c,v 1.34 2002/03/12 22:08:24 alex Exp $
|
* $Id: ngircd.c,v 1.35 2002/03/25 19:11:01 alex Exp $
|
||||||
*
|
*
|
||||||
* ngircd.c: Hier beginnt alles ;-)
|
* ngircd.c: Hier beginnt alles ;-)
|
||||||
*/
|
*/
|
||||||
@ -50,10 +50,11 @@ LOCAL VOID Show_Version( VOID );
|
|||||||
LOCAL VOID Show_Help( VOID );
|
LOCAL VOID Show_Help( VOID );
|
||||||
|
|
||||||
|
|
||||||
GLOBAL INT main( INT argc, CONST CHAR *argv[] )
|
GLOBAL int main( int argc, const char *argv[] )
|
||||||
{
|
{
|
||||||
BOOLEAN ok;
|
BOOLEAN ok;
|
||||||
INT pid, i, n;
|
INT32 pid, n;
|
||||||
|
INT i;
|
||||||
|
|
||||||
NGIRCd_Restart = FALSE;
|
NGIRCd_Restart = FALSE;
|
||||||
NGIRCd_Quit = FALSE;
|
NGIRCd_Quit = FALSE;
|
||||||
@ -114,7 +115,7 @@ GLOBAL INT main( INT argc, CONST CHAR *argv[] )
|
|||||||
{
|
{
|
||||||
/* Kurze Option */
|
/* Kurze Option */
|
||||||
|
|
||||||
for( n = 1; n < strlen( argv[i] ); n++ )
|
for( n = 1; n < (INT32)strlen( argv[i] ); n++ )
|
||||||
{
|
{
|
||||||
ok = FALSE;
|
ok = FALSE;
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
@ -177,7 +178,7 @@ GLOBAL INT main( INT argc, CONST CHAR *argv[] )
|
|||||||
if( ! NGIRCd_NoDaemon )
|
if( ! NGIRCd_NoDaemon )
|
||||||
{
|
{
|
||||||
/* Daemon im Hintergrund erzeugen */
|
/* Daemon im Hintergrund erzeugen */
|
||||||
pid = fork( );
|
pid = (INT32)fork( );
|
||||||
if( pid > 0 )
|
if( pid > 0 )
|
||||||
{
|
{
|
||||||
/* "alter" Prozess */
|
/* "alter" Prozess */
|
||||||
@ -191,13 +192,13 @@ GLOBAL INT main( INT argc, CONST CHAR *argv[] )
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Child-Prozess initialisieren */
|
/* Child-Prozess initialisieren */
|
||||||
setsid( );
|
(VOID)setsid( );
|
||||||
chdir( "/" );
|
chdir( "/" );
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Globale Variablen initialisieren */
|
/* Globale Variablen initialisieren */
|
||||||
NGIRCd_Start = time( NULL );
|
NGIRCd_Start = time( NULL );
|
||||||
strftime( NGIRCd_StartStr, 64, "%a %b %d %Y at %H:%M:%S (%Z)", localtime( &NGIRCd_Start ));
|
(VOID)strftime( NGIRCd_StartStr, 64, "%a %b %d %Y at %H:%M:%S (%Z)", localtime( &NGIRCd_Start ));
|
||||||
NGIRCd_Restart = FALSE;
|
NGIRCd_Restart = FALSE;
|
||||||
NGIRCd_Quit = FALSE;
|
NGIRCd_Quit = FALSE;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user