forked from metin2/server
Fixed various datatype and buffer issues
This commit is contained in:
@ -185,7 +185,7 @@ void _sys_err(const char *func, int line, const char *format, ...)
|
||||
}
|
||||
#endif
|
||||
|
||||
static char sys_log_header_string[33] = { 0, };
|
||||
static char sys_log_header_string[33] = "";
|
||||
|
||||
void sys_log_header(const char *header)
|
||||
{
|
||||
@ -316,7 +316,7 @@ void log_file_delete_old(const char *filename)
|
||||
struct stat sb;
|
||||
int num1, num2;
|
||||
char buf[32];
|
||||
char system_cmd[64];
|
||||
char system_cmd[512];
|
||||
struct tm new_tm;
|
||||
|
||||
if (stat(filename, &sb) == -1)
|
||||
@ -361,7 +361,7 @@ void log_file_delete_old(const char *filename)
|
||||
|
||||
if (num2 <= num1)
|
||||
{
|
||||
sprintf(system_cmd, "rm -rf %s/%s", filename, name);
|
||||
snprintf(system_cmd, sizeof(system_cmd), "rm -rf %s/%s", filename, name);
|
||||
system(system_cmd);
|
||||
|
||||
sys_log(0, "%s: SYSTEM_CMD: %s", __FUNCTION__, system_cmd);
|
||||
@ -404,7 +404,7 @@ void log_file_rotate(LPLOGFILE logfile)
|
||||
struct tm curr_tm;
|
||||
time_t time_s;
|
||||
char dir[256];
|
||||
char system_cmd[256];
|
||||
char system_cmd[512];
|
||||
|
||||
time_s = time(0);
|
||||
curr_tm = *localtime(&time_s);
|
||||
|
Reference in New Issue
Block a user