1
0
mirror of https://github.com/Tha14/toxic.git synced 2025-06-20 13:16:36 +02:00

enforce const correctess, fix undefined behaviour with string literals

This commit is contained in:
Jfreegman
2014-07-29 14:54:34 -04:00
parent cbe47b3660
commit 973f6206ee
9 changed files with 68 additions and 59 deletions

View File

@ -34,7 +34,7 @@
extern struct user_settings *user_settings_;
/* Creates/fetches log file by appending to the config dir the name and a pseudo-unique identity */
void init_logging_session(char *name, char *key, struct chatlog *log)
void init_logging_session(char *name, const char *key, struct chatlog *log)
{
if (!log->log_on)
return;
@ -80,7 +80,7 @@ void init_logging_session(char *name, char *key, struct chatlog *log)
fprintf(log->file, "\n*** NEW SESSION ***\n\n");
}
void write_to_log(const char *msg, char *name, struct chatlog *log, bool event)
void write_to_log(const char *msg, const char *name, struct chatlog *log, bool event)
{
if (!log->log_on)
return;
@ -110,7 +110,7 @@ void write_to_log(const char *msg, char *name, struct chatlog *log, bool event)
}
}
void log_enable(char *name, char *key, struct chatlog *log)
void log_enable(char *name, const char *key, struct chatlog *log)
{
log->log_on = true;