diff options
Diffstat (limited to 'src/login/loginlog_sql.c')
-rw-r--r-- | src/login/loginlog_sql.c | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/src/login/loginlog_sql.c b/src/login/loginlog_sql.c index 5654b4c5b..da698e187 100644 --- a/src/login/loginlog_sql.c +++ b/src/login/loginlog_sql.c @@ -6,14 +6,14 @@ #include "loginlog.h" -#include <string.h> -#include <stdlib.h> // exit +#include "common/cbasetypes.h" +#include "common/mmo.h" +#include "common/nullpo.h" +#include "common/socket.h" +#include "common/sql.h" +#include "common/strlib.h" -#include "../common/cbasetypes.h" -#include "../common/mmo.h" -#include "../common/socket.h" -#include "../common/sql.h" -#include "../common/strlib.h" +#include <stdlib.h> // exit // global sql settings (in ipban_sql.c) static char global_db_hostname[32] = "127.0.0.1"; @@ -61,12 +61,15 @@ unsigned long loginlog_failedattempts(uint32 ip, unsigned int minutes) /*============================================= * Records an event in the login log *---------------------------------------------*/ +// TODO: add an enum of rcode values void login_log(uint32 ip, const char* username, int rcode, const char* message) { char esc_username[NAME_LENGTH*2+1]; char esc_message[255*2+1]; int retcode; + nullpo_retv(username); + nullpo_retv(message); if( !enabled ) return; @@ -137,6 +140,8 @@ bool loginlog_config_read(const char* key, const char* value) { const char* signature; + nullpo_ret(key); + nullpo_ret(value); signature = "sql."; if( strncmpi(key, signature, strlen(signature)) == 0 ) { |