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

@ -362,6 +362,8 @@ logfilegroup_t *log_find_file(log_t *logdata, char *destination)
/* /*
* Da log routines * 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) 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, void log_part(log_t *logdata, char *ircmask, char *channel,
char *message) char *message)
{ {
if (message)
snprintf(logdata->buffer, LOGLINE_MAXLEN, snprintf(logdata->buffer, LOGLINE_MAXLEN,
"%s -!- %s has left %s [%s]", timestamp(), ircmask, "%s -!- %s has left %s [%s]", timestamp(), ircmask,
channel, message); channel, message);
else
snprintf(logdata->buffer, LOGLINE_MAXLEN,
"%s -!- %s has left %s", timestamp(), ircmask,
channel);
log_write(logdata, channel, logdata->buffer); log_write(logdata, channel, logdata->buffer);
} }