1
0
forked from bip/bip

Cleanups.

This commit is contained in:
Arnaud Cornet 2007-11-18 11:08:41 +01:00
parent a21488ead6
commit 51f5a91664
2 changed files with 10 additions and 3 deletions

View File

@ -1473,7 +1473,7 @@ static int irc_part(struct link_server *server, struct line *line)
free(s_nick);
log_part(LINK(server)->log, line->origin, s_chan,
line->elemc == 3 ? line->elemv[2]:NULL);
line->elemc == 3 ? line->elemv[2] : NULL);
nick_free(nick);
return OK_COPY;

View File

@ -362,6 +362,8 @@ logfilegroup_t *log_find_file(log_t *logdata, char *destination)
/*
* Da log routines
* There are a lot of snprintf's here without enforcing the last \0 in the
* buffer, but _log_write takes care of this for us.
*/
void log_join(log_t *logdata, char *ircmask, char *channel)
{
@ -374,9 +376,14 @@ void log_join(log_t *logdata, char *ircmask, char *channel)
void log_part(log_t *logdata, char *ircmask, char *channel,
char *message)
{
snprintf(logdata->buffer, LOGLINE_MAXLEN,
if (message)
snprintf(logdata->buffer, LOGLINE_MAXLEN,
"%s -!- %s has left %s [%s]", timestamp(), ircmask,
channel, message);
else
snprintf(logdata->buffer, LOGLINE_MAXLEN,
"%s -!- %s has left %s", timestamp(), ircmask,
channel);
log_write(logdata, channel, logdata->buffer);
}