added one byte to buffer allocation

see 875c3c34d90d2845325db2739233d9312f056785
This commit is contained in:
Václav Šmejkal 2022-12-11 16:20:53 +01:00
parent 875c3c34d9
commit 403cb396b6
No known key found for this signature in database
GPG Key ID: FD749A97DF2D5E19

View File

@ -131,7 +131,7 @@ void writeLog(int loggerFile, char *logMessage)
message = strdup(logMessage); //COPY message = strdup(logMessage); //COPY
} }
buffer = malloc(strlen(WRITE_FORMAT) + strlen(message) + 2); //ALLOCATE buffer = malloc(strlen(WRITE_FORMAT) + strlen(message) + 3); //ALLOCATE
sprintf(buffer, WRITE_FORMATTING, tm.tm_hour, tm.tm_min, tm.tm_sec, message); //LOAD MESSAGE sprintf(buffer, WRITE_FORMATTING, tm.tm_hour, tm.tm_min, tm.tm_sec, message); //LOAD MESSAGE