Avoid referencing before allocated memory on empty string.
r2265 | dcl | 2008-01-15 12:00:53 +1100 (Tue, 15 Jan 2008) | 2 lines
This commit is contained in:
@@ -333,7 +333,7 @@ static const char* timestamp(void) {
|
||||
fprintf(fLogFile,"%s: <<<open logfile>>>\n", timestamp());
|
||||
fprintf(fLogFile,"%s: ", timestamp());
|
||||
fprintf(fLogFile,"%s", pText);
|
||||
if (pText[text_len - 1] != '\n')
|
||||
if (text_len < 1 || pText[text_len - 1] != '\n')
|
||||
fprintf(fLogFile,"\n");
|
||||
fflush(fLogFile);
|
||||
iLineCount++;
|
||||
|
||||
Reference in New Issue
Block a user