]> arthur.barton.de Git - ngircd.git/commitdiff
Whitespace fixes (no functional changes)
authorAlexander Barton <alex@barton.de>
Sat, 1 Aug 2015 13:15:30 +0000 (15:15 +0200)
committerAlexander Barton <alex@barton.de>
Sat, 1 Aug 2015 13:15:30 +0000 (15:15 +0200)
12 files changed:
src/ngircd/channel.c
src/ngircd/client.c
src/ngircd/conf.c
src/ngircd/conn-func.c
src/ngircd/conn-ssl.c
src/ngircd/conn-zip.c
src/ngircd/conn.c
src/ngircd/login.c
src/ngircd/ngircd.c
src/ngircd/parse.c
src/portab/portabtest.c
src/portab/vsnprintf.c

index 02eb235754217588b7767d9d2a13e49a9f0a6201..53c385c2c158f602265f81f02d086817b2de7f30 100644 (file)
@@ -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 );
index 07d448fdbaf9a84873f32e22584636251e2d3fd5..7e6ff68afd4b8cf84e68d116f2ebe3bcd64d0fc3 100644 (file)
@@ -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 */
index 62b5044c87be0daa7569846c6d07d42f1bf67417..98a2c1d790f63eadeda6dcd2073046a4407055ec 100644 (file)
@@ -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 = ");
index fb5c55fa1289b8c8aa3527dbb32b605c6246357c..b6e82849b0c6ae98f9441cafff8f67d5487d58f7 100644 (file)
@@ -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;
index be6ee0a8f9490be9dd5a15976d483ab0d9a850d0..2cb734d4c7378439065e552ff6c999b0b85e7ddf 100644 (file)
@@ -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- */
-
-
index e21dd345777a35c599f308aee587c6dee377c4dd..fe7f2fb0e06ffc169aa1956065eaf30e2021c00c 100644 (file)
@@ -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 );
index edcd868efba8b30a6113897b6f94df18db18b6b7..4a028ac7794b0fc7eeb9be7c825c0d94e506ff97 100644 (file)
@@ -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;
 
index 64cc81251c6594cbd129a56270262fa9fede6c19..ba9378f824e333b1576bb7837094acf221d6b26e 100644 (file)
@@ -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;
index 0e8acb54213e3a3c6e54e99affdf0b9bfed22871..347c41fa2325d24bfb8c753fbf14535c3421a2f1 100644 (file)
@@ -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
index 58205256fe590c6362cc0db5c2e175a58675780a..d9b43cf092bea1dff69ece518a57137b31dfd6cc 100644 (file)
@@ -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 :-)
index 4980765716de5cf6cc7a838f91132623079c48c1..e7b0dcc838ad3b0e82fb9edf1b2475525327cda6 100644 (file)
@@ -196,7 +196,7 @@ main(void)
        Check_strlcat();
        Check_strtok_r();
        Check_vsnprintf(2+10, "%s%s", "ab", "1234567890");
-       
+
        return 0;
 }
 
index 39a6c5fae903ba717c2af15eba44f74c5902a7ed..4c65db1febd5c30008f421a0a6d1e45b28f8e11c 100644 (file)
@@ -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);