Fixed various datatype and buffer issues

This commit is contained in:
2022-12-24 19:59:00 +02:00
parent 71189e7c08
commit 7c821325c7
9 changed files with 23 additions and 23 deletions

View File

@ -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);