commit - 0083fe177f727af6ab43e190e3bea8a94555348e
commit + 9811223fb882413645db38948ac05fa21ddd3514
blob - 02eb235754217588b7767d9d2a13e49a9f0a6201
blob + 53c385c2c158f602265f81f02d086817b2de7f30
--- src/ngircd/channel.c
+++ src/ngircd/channel.c
!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;
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 );
blob - 07d448fdbaf9a84873f32e22584636251e2d3fd5
blob + 7e6ff68afd4b8cf84e68d116f2ebe3bcd64d0fc3
--- src/ngircd/client.c
+++ src/ngircd/client.c
Client_Init( void )
{
struct hostent *h;
-
+
This_Server = New_Client_Struct( );
if( ! This_Server )
{
Client_SetInfo( This_Server, Conf_ServerInfo );
My_Clients = This_Server;
-
+
memset( &My_Whowas, 0, sizeof( My_Whowas ));
} /* Client_Init */
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) {
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;
{
assert( Client != NULL );
assert( ID != NULL );
-
+
strlcpy( Client->id, ID, sizeof( Client->id ));
if (Conf_CloakUserToNick) {
if(Client->type == CLIENT_USER)
assert(strlen(Client->id) < Conf_MaxNickLength);
#endif
-
+
if( Client->id[0] ) return Client->id;
else return "*";
} /* Client_ID */
blob - 62b5044c87be0daa7569846c6d07d42f1bf67417
blob + 98a2c1d790f63eadeda6dcd2073046a4407055ec
--- src/ngircd/conf.c
+++ src/ngircd/conf.c
? (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 = ");
blob - fb5c55fa1289b8c8aa3527dbb32b605c6246357c
blob + b6e82849b0c6ae98f9441cafff8f67d5487d58f7
--- src/ngircd/conn-func.c
+++ src/ngircd/conn-func.c
Conn_First( void )
{
CONN_ID i;
-
+
for( i = 0; i < Pool_Size; i++ )
{
if( My_Connections[i].sock != NONE ) return i;
CONN_ID i = NONE;
assert( Idx > NONE );
-
+
for( i = Idx + 1; i < Pool_Size; i++ )
{
if( My_Connections[i].sock != NONE ) return i;
blob - be6ee0a8f9490be9dd5a15976d483ab0d9a850d0
blob + 2cb734d4c7378439065e552ff6c999b0b85e7ddf
--- src/ngircd/conn-ssl.c
+++ src/ngircd/conn-ssl.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);
#endif /* SSL_SUPPORT */
/* -eof- */
-
-
blob - e21dd345777a35c599f308aee587c6dee377c4dd
blob + fe7f2fb0e06ffc169aa1956065eaf30e2021c00c
--- src/ngircd/conn-zip.c
+++ src/ngircd/conn-zip.c
}
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;
int unzipbuf_used = 0;
unsigned int z_rdatalen;
unsigned int in_len;
-
+
z_stream *in;
assert( Idx > NONE );
blob - edcd868efba8b30a6113897b6f94df18db18b6b7
blob + 4a028ac7794b0fc7eeb9be7c825c0d94e506ff97
--- src/ngircd/conn.c
+++ src/ngircd/conn.c
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++)
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;
* 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,
* @returns Pointer to CLIENT structure.
*/
GLOBAL CLIENT *
-Conn_GetClient( CONN_ID Idx )
+Conn_GetClient( CONN_ID Idx )
{
CONNECTION *c;
blob - 64cc81251c6594cbd129a56270262fa9fede6c19
blob + ba9378f824e333b1576bb7837094acf221d6b26e
--- src/ngircd/login.c
+++ src/ngircd/login.c
/* 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;
blob - 0e8acb54213e3a3c6e54e99affdf0b9bfed22871
blob + 347c41fa2325d24bfb8c753fbf14535c3421a2f1
--- src/ngircd/ngircd.c
+++ src/ngircd/ngircd.c
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));
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
blob - 58205256fe590c6362cc0db5c2e175a58675780a
blob + d9b43cf092bea1dff69ece518a57137b31dfd6cc
--- src/ngircd/parse.c
+++ src/ngircd/parse.c
/**
* 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 :-)
blob - 4980765716de5cf6cc7a838f91132623079c48c1
blob + e7b0dcc838ad3b0e82fb9edf1b2475525327cda6
--- src/portab/portabtest.c
+++ src/portab/portabtest.c
Check_strlcat();
Check_strtok_r();
Check_vsnprintf(2+10, "%s%s", "ab", "1234567890");
-
+
return 0;
}
blob - 39a6c5fae903ba717c2af15eba44f74c5902a7ed
blob + 4c65db1febd5c30008f421a0a6d1e45b28f8e11c
--- src/portab/vsnprintf.c
+++ src/portab/vsnprintf.c
* 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
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;
if (ch == '.') {
state = DP_S_MAX;
ch = *format++;
- } else {
+ } else {
state = DP_S_MOD;
}
break;
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);
}
}
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;
}
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;
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 = '-';
signvalue = ' ';
}
}
-
+
if (flags & DP_F_UP) caps = 1; /* Should characters be upper case? */
do {
zpadlen = MAX(zpadlen, spadlen);
spadlen = 0;
}
- if (flags & DP_F_MINUS)
+ if (flags & DP_F_MINUS)
spadlen = -spadlen; /* Left Justifty */
#ifdef DEBUG_SNPRINTF
}
/* Sign */
- if (signvalue)
+ if (signvalue)
dopr_outch (buffer, currlen, maxlen, signvalue);
/* Zeros */
}
/* 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, ' ');
if (value < 0)
result = -value;
-
+
return result;
}
POW10(int exp)
{
LDOUBLE result = 1;
-
+
while (exp) {
result *= 10;
exp--;
}
-
+
return result;
}
intpart = (LLONG)value;
value = value - intpart;
if (value >= 0.5) intpart++;
-
+
return intpart;
}
ret = my_modf(x0-l*f, &i2);
(*iptr) = l*f + i2;
return ret;
- }
+ }
(*iptr) = l;
return x - (*iptr);
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
*/
}
}
- /*
- * 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)
my_modf(temp, &intpart);
fracpart = ROUND((POW10(max)) * (ufvalue - intpart));
-
+
if (fracpart >= POW10(max)) {
intpart++;
fracpart -= POW10(max);
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);
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
*/
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;
{
size_t ret;
va_list ap;
-
+
va_start(ap, fmt);
ret = vsnprintf(str, count, fmt, ap);
va_end(ap);