ngircd

Free, portable and lightweight Internet Relay Chat server http://ngircd.barton.de/
Log | Files | Refs | README | LICENSE

commit 9811223fb882413645db38948ac05fa21ddd3514
parent 0083fe177f727af6ab43e190e3bea8a94555348e
Author: Alexander Barton <alex@barton.de>
Date:   Sat,  1 Aug 2015 15:15:30 +0200

Whitespace fixes (no functional changes)

Diffstat:
Msrc/ngircd/channel.c | 10+++++-----
Msrc/ngircd/client.c | 12++++++------
Msrc/ngircd/conf.c | 2+-
Msrc/ngircd/conn-func.c | 4++--
Msrc/ngircd/conn-ssl.c | 4+---
Msrc/ngircd/conn-zip.c | 4++--
Msrc/ngircd/conn.c | 8++++----
Msrc/ngircd/login.c | 2+-
Msrc/ngircd/ngircd.c | 4++--
Msrc/ngircd/parse.c | 2+-
Msrc/portab/portabtest.c | 2+-
Msrc/portab/vsnprintf.c | 92++++++++++++++++++++++++++++++++++++++++----------------------------------------
12 files changed, 72 insertions(+), 74 deletions(-)

diff --git a/src/ngircd/channel.c b/src/ngircd/channel.c @@ -352,16 +352,16 @@ Channel_Kick(CLIENT *Peer, CLIENT *Target, CLIENT *Origin, const char *Name, !Channel_UserHasMode(chan, Target, 'q') && !Channel_UserHasMode(chan, Target, 'a')) can_kick = true; - - /* Half Op can't kick owner | admin | op */ + + /* Half Op can't kick owner | admin | op */ else if (Channel_UserHasMode(chan, Peer, 'h') && !Channel_UserHasMode(chan, Target, 'q') && !Channel_UserHasMode(chan, Target, 'a') && !Channel_UserHasMode(chan, Target, 'o')) can_kick = true; - + /* IRC operators & IRCd with OperCanMode enabled - * can kick anyways regardless of privilege */ + * can kick anyways regardless of privilege */ else if(Client_HasMode(Origin, 'o') && Conf_OperCanMode) can_kick = true; @@ -1044,7 +1044,7 @@ Remove_Client( int Type, CHANNEL *Chan, CLIENT *Client, CLIENT *Origin, const ch switch( Type ) { case REMOVE_QUIT: - /* QUIT: other servers have already been notified, + /* QUIT: other servers have already been notified, * see Client_Destroy(); so only inform other clients * in same channel. */ assert( InformServer == false ); diff --git a/src/ngircd/client.c b/src/ngircd/client.c @@ -72,7 +72,7 @@ GLOBAL void Client_Init( void ) { struct hostent *h; - + This_Server = New_Client_Struct( ); if( ! This_Server ) { @@ -98,7 +98,7 @@ Client_Init( void ) Client_SetInfo( This_Server, Conf_ServerInfo ); My_Clients = This_Server; - + memset( &My_Whowas, 0, sizeof( My_Whowas )); } /* Client_Init */ @@ -111,7 +111,7 @@ Client_Exit( void ) if( NGIRCd_SignalRestart ) Client_Destroy( This_Server, "Server going down (restarting).", NULL, false ); else Client_Destroy( This_Server, "Server going down.", NULL, false ); - + cnt = 0; c = My_Clients; while(c) { @@ -228,7 +228,7 @@ GLOBAL void Client_Destroy( CLIENT *Client, const char *LogMsg, const char *FwdMsg, bool SendQuit ) { /* remove a client */ - + CLIENT *last, *c; char msg[COMMAND_LEN]; const char *txt; @@ -381,7 +381,7 @@ Client_SetID( CLIENT *Client, const char *ID ) { assert( Client != NULL ); assert( ID != NULL ); - + strlcpy( Client->id, ID, sizeof( Client->id )); if (Conf_CloakUserToNick) { @@ -698,7 +698,7 @@ Client_ID( CLIENT *Client ) if(Client->type == CLIENT_USER) assert(strlen(Client->id) < Conf_MaxNickLength); #endif - + if( Client->id[0] ) return Client->id; else return "*"; } /* Client_ID */ diff --git a/src/ngircd/conf.c b/src/ngircd/conf.c @@ -364,7 +364,7 @@ Conf_Test( void ) ? (const char*) array_start(&Conf_Motd) : ""); } printf(" Network = %s\n", Conf_Network); - if (!Conf_PAM) + if (!Conf_PAM) printf(" Password = %s\n", Conf_ServerPwd); printf(" PidFile = %s\n", Conf_PidFile); printf(" Ports = "); diff --git a/src/ngircd/conn-func.c b/src/ngircd/conn-func.c @@ -138,7 +138,7 @@ GLOBAL CONN_ID Conn_First( void ) { CONN_ID i; - + for( i = 0; i < Pool_Size; i++ ) { if( My_Connections[i].sock != NONE ) return i; @@ -152,7 +152,7 @@ Conn_Next( CONN_ID Idx ) CONN_ID i = NONE; assert( Idx > NONE ); - + for( i = Idx + 1; i < Pool_Size; i++ ) { if( My_Connections[i].sock != NONE ) return i; diff --git a/src/ngircd/conn-ssl.c b/src/ngircd/conn-ssl.c @@ -745,7 +745,7 @@ ConnSSL_InitCertFp( CONNECTION *c ) gnutls_x509_crt_deinit(cert); return 0; } - + if (gnutls_x509_crt_import(cert, &cert_list[0], GNUTLS_X509_FMT_DER) != GNUTLS_E_SUCCESS) { gnutls_x509_crt_deinit(cert); @@ -912,5 +912,3 @@ ConnSSL_InitLibrary(void) #endif /* SSL_SUPPORT */ /* -eof- */ - - diff --git a/src/ngircd/conn-zip.c b/src/ngircd/conn-zip.c @@ -175,7 +175,7 @@ Zip_Flush( CONN_ID Idx ) } My_Connections[Idx].bytes_out += zipbuf_used; - My_Connections[Idx].zip.bytes_out += array_bytes(&My_Connections[Idx].zip.wbuf); + My_Connections[Idx].zip.bytes_out += array_bytes(&My_Connections[Idx].zip.wbuf); array_trunc(&My_Connections[Idx].zip.wbuf); return true; @@ -198,7 +198,7 @@ Unzip_Buffer( CONN_ID Idx ) int unzipbuf_used = 0; unsigned int z_rdatalen; unsigned int in_len; - + z_stream *in; assert( Idx > NONE ); diff --git a/src/ngircd/conn.c b/src/ngircd/conn.c @@ -328,7 +328,7 @@ Conn_Init( void ) array_bytes(&My_ConnArray)); assert(array_length(&My_ConnArray, sizeof(CONNECTION)) >= (size_t)Pool_Size); - + array_free( &My_Listeners ); for (i = 0; i < Pool_Size; i++) @@ -796,7 +796,7 @@ Conn_Handler(void) GLOBAL bool Conn_WriteStr(CONN_ID Idx, const char *Format, ...) #else -GLOBAL bool +GLOBAL bool Conn_WriteStr(Idx, Format, va_alist) CONN_ID Idx; const char *Format; @@ -829,7 +829,7 @@ va_dcl * IRC_WriteXXX() functions when the prefix of this server had * to be added to an already "quite long" command line which * has been received from a regular IRC client, for example. - * + * * We are not allowed to send such "oversized" messages to * other servers and clients, see RFC 2812 2.3 and 2813 3.3 * ("these messages SHALL NOT exceed 512 characters in length, @@ -2364,7 +2364,7 @@ Simple_Message(int Sock, const char *Msg) * @returns Pointer to CLIENT structure. */ GLOBAL CLIENT * -Conn_GetClient( CONN_ID Idx ) +Conn_GetClient( CONN_ID Idx ) { CONNECTION *c; diff --git a/src/ngircd/login.c b/src/ngircd/login.c @@ -92,7 +92,7 @@ Login_User(CLIENT * Client) /* Don't do any PAM authentication at all if PAM is not * enabled, instead emulate the behavior of the daemon * compiled without PAM support. */ - if (strcmp(Conn_Password(conn), Conf_ServerPwd) == 0) + if (strcmp(Conn_Password(conn), Conf_ServerPwd) == 0) return Login_User_PostAuth(Client); Client_Reject(Client, "Bad server password", false); return DISCONNECTED; diff --git a/src/ngircd/ngircd.c b/src/ngircd/ngircd.c @@ -530,7 +530,7 @@ Pidfile_Create(pid_t pid) close(pidfd); return; } - + if (write(pidfd, pidbuf, (size_t)len) != (ssize_t)len) Log(LOG_ERR, "Can't write PID file (%s): %s!", Conf_PidFile, strerror(errno)); @@ -721,7 +721,7 @@ NGIRCd_Init(bool NGIRCd_NoDaemon) Log(LOG_ERR, "Can't change group ID to %s(%u): %s!", grp ? grp->gr_name : "?", Conf_GID, strerror(real_errno)); - if (real_errno != EPERM) + if (real_errno != EPERM) goto out; } #ifdef HAVE_SETGROUPS diff --git a/src/ngircd/parse.c b/src/ngircd/parse.c @@ -156,7 +156,7 @@ Parse_GetCommandStruct( void ) /** * Parse a command ("request") received from a client. - * + * * This function is called after the connection layer received a valid CR+LF * terminated line of text: we assume that this is a valid IRC command and * try to do something useful with it :-) diff --git a/src/portab/portabtest.c b/src/portab/portabtest.c @@ -196,7 +196,7 @@ main(void) Check_strlcat(); Check_strtok_r(); Check_vsnprintf(2+10, "%s%s", "ab", "1234567890"); - + return 0; } diff --git a/src/portab/vsnprintf.c b/src/portab/vsnprintf.c @@ -50,9 +50,9 @@ * original. Also, there is now a builtin-test, just compile with: * gcc -DTEST_SNPRINTF -o snprintf snprintf.c -lm * and run snprintf for results. - * + * * Thomas Roessler <roessler@guug.de> 01/27/98 for mutt 0.89i - * The PGP code was using unsigned hexadecimal formats. + * The PGP code was using unsigned hexadecimal formats. * Unfortunately, unsigned formats simply didn't work. * * Michael Elkins <me@cs.hmc.edu> 03/05/98 for mutt 0.90.8 @@ -165,21 +165,21 @@ dopr(char *buffer, size_t maxlen, const char *format, va_list args) int flags; int cflags; size_t currlen; - + state = DP_S_DEFAULT; currlen = flags = cflags = min = 0; max = -1; ch = *format++; - + while (state != DP_S_DONE) { - if (ch == '\0') + if (ch == '\0') state = DP_S_DONE; switch(state) { case DP_S_DEFAULT: - if (ch == '%') + if (ch == '%') state = DP_S_FLAGS; - else + else dopr_outch (buffer, &currlen, maxlen, ch); ch = *format++; break; @@ -226,7 +226,7 @@ dopr(char *buffer, size_t maxlen, const char *format, va_list args) if (ch == '.') { state = DP_S_MAX; ch = *format++; - } else { + } else { state = DP_S_MOD; } break; @@ -271,7 +271,7 @@ dopr(char *buffer, size_t maxlen, const char *format, va_list args) switch (ch) { case 'd': case 'i': - if (cflags == DP_C_SHORT) + if (cflags == DP_C_SHORT) value = va_arg (args, int); else if (cflags == DP_C_LONG) value = va_arg (args, long int); @@ -401,12 +401,12 @@ dopr(char *buffer, size_t maxlen, const char *format, va_list args) } } if (maxlen != 0) { - if (currlen < maxlen - 1) + if (currlen < maxlen - 1) buffer[currlen] = '\0'; - else if (maxlen > 0) + else if (maxlen > 0) buffer[maxlen - 1] = '\0'; } - + return currlen; } @@ -426,11 +426,11 @@ fmtstr(char *buffer, size_t *currlen, size_t maxlen, char *value, int flags, for (strln = 0; value[strln]; ++strln); /* strlen */ padlen = min - strln; - if (padlen < 0) + if (padlen < 0) padlen = 0; - if (flags & DP_F_MINUS) + if (flags & DP_F_MINUS) padlen = -padlen; /* Left Justify */ - + while ((padlen > 0) && (cnt < max)) { dopr_outch (buffer, currlen, maxlen, ' '); --padlen; @@ -460,12 +460,12 @@ fmtint(char *buffer, size_t *currlen, size_t maxlen, long value, int base, int spadlen = 0; /* amount to space pad */ int zpadlen = 0; /* amount to zero pad */ int caps = 0; - + if (max < 0) max = 0; - + uvalue = value; - + if(!(flags & DP_F_UNSIGNED)) { if( value < 0 ) { signvalue = '-'; @@ -477,7 +477,7 @@ fmtint(char *buffer, size_t *currlen, size_t maxlen, long value, int base, signvalue = ' '; } } - + if (flags & DP_F_UP) caps = 1; /* Should characters be upper case? */ do { @@ -497,7 +497,7 @@ fmtint(char *buffer, size_t *currlen, size_t maxlen, long value, int base, zpadlen = MAX(zpadlen, spadlen); spadlen = 0; } - if (flags & DP_F_MINUS) + if (flags & DP_F_MINUS) spadlen = -spadlen; /* Left Justifty */ #ifdef DEBUG_SNPRINTF @@ -512,7 +512,7 @@ fmtint(char *buffer, size_t *currlen, size_t maxlen, long value, int base, } /* Sign */ - if (signvalue) + if (signvalue) dopr_outch (buffer, currlen, maxlen, signvalue); /* Zeros */ @@ -524,9 +524,9 @@ fmtint(char *buffer, size_t *currlen, size_t maxlen, long value, int base, } /* Digits */ - while (place > 0) + while (place > 0) dopr_outch (buffer, currlen, maxlen, convert[--place]); - + /* Left Justified spaces */ while (spadlen < 0) { dopr_outch (buffer, currlen, maxlen, ' '); @@ -541,7 +541,7 @@ abs_val(LDOUBLE value) if (value < 0) result = -value; - + return result; } @@ -549,12 +549,12 @@ static LDOUBLE POW10(int exp) { LDOUBLE result = 1; - + while (exp) { result *= 10; exp--; } - + return result; } @@ -566,7 +566,7 @@ ROUND(LDOUBLE value) intpart = (LLONG)value; value = value - intpart; if (value >= 0.5) intpart++; - + return intpart; } @@ -600,7 +600,7 @@ my_modf(double x0, double *iptr) ret = my_modf(x0-l*f, &i2); (*iptr) = l*f + i2; return ret; - } + } (*iptr) = l; return x - (*iptr); @@ -618,14 +618,14 @@ fmtfp (char *buffer, size_t *currlen, size_t maxlen, LDOUBLE fvalue, int iplace = 0; int fplace = 0; int padlen = 0; /* amount to pad */ - int zpadlen = 0; + int zpadlen = 0; int caps = 0; int index; double intpart; double fracpart; double temp; - - /* + + /* * AIX manpage says the default is 0, but Solaris says the default * is 6, and sprintf on AIX defaults to 6 */ @@ -645,8 +645,8 @@ fmtfp (char *buffer, size_t *currlen, size_t maxlen, LDOUBLE fvalue, } } - /* - * Sorry, we only support 16 digits past the decimal because of our + /* + * Sorry, we only support 16 digits past the decimal because of our * conversion method */ if (max > 16) @@ -660,7 +660,7 @@ fmtfp (char *buffer, size_t *currlen, size_t maxlen, LDOUBLE fvalue, my_modf(temp, &intpart); fracpart = ROUND((POW10(max)) * (ufvalue - intpart)); - + if (fracpart >= POW10(max)) { intpart++; fracpart -= POW10(max); @@ -697,16 +697,16 @@ fmtfp (char *buffer, size_t *currlen, size_t maxlen, LDOUBLE fvalue, if (fplace == 311) fplace--; } fconvert[fplace] = 0; - + /* -1 for decimal point, another -1 if we are printing a sign */ - padlen = min - iplace - max - 1 - ((signvalue) ? 1 : 0); + padlen = min - iplace - max - 1 - ((signvalue) ? 1 : 0); zpadlen = max - fplace; if (zpadlen < 0) zpadlen = 0; - if (padlen < 0) + if (padlen < 0) padlen = 0; - if (flags & DP_F_MINUS) + if (flags & DP_F_MINUS) padlen = -padlen; /* Left Justifty */ - + if ((flags & DP_F_ZERO) && (padlen > 0)) { if (signvalue) { dopr_outch (buffer, currlen, maxlen, signvalue); @@ -722,10 +722,10 @@ fmtfp (char *buffer, size_t *currlen, size_t maxlen, LDOUBLE fvalue, dopr_outch (buffer, currlen, maxlen, ' '); --padlen; } - if (signvalue) + if (signvalue) dopr_outch (buffer, currlen, maxlen, signvalue); - - while (iplace > 0) + + while (iplace > 0) dopr_outch (buffer, currlen, maxlen, iconvert[--iplace]); #ifdef DEBUG_SNPRINTF @@ -738,11 +738,11 @@ fmtfp (char *buffer, size_t *currlen, size_t maxlen, LDOUBLE fvalue, */ if (max > 0) { dopr_outch (buffer, currlen, maxlen, '.'); - - while (fplace > 0) + + while (fplace > 0) dopr_outch (buffer, currlen, maxlen, fconvert[--fplace]); } - + while (zpadlen > 0) { dopr_outch (buffer, currlen, maxlen, '0'); --zpadlen; @@ -786,7 +786,7 @@ va_dcl { size_t ret; va_list ap; - + va_start(ap, fmt); ret = vsnprintf(str, count, fmt, ap); va_end(ap);