Skip to content
Snippets Groups Projects
Commit 157ad10e authored by rswindell's avatar rswindell
Browse files

Fix possible exception/segfault when sbbs_t::log() is passed a blank string.

parent b689e483
No related branches found
No related tags found
No related merge requests found
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
* @format.tab-size 4 (Plain Text/Source Code File Header) * * @format.tab-size 4 (Plain Text/Source Code File Header) *
* @format.use-tabs true (see http://www.synchro.net/ptsc_hdr.html) * * @format.use-tabs true (see http://www.synchro.net/ptsc_hdr.html) *
* * * *
* Copyright 2007 Rob Swindell - http://www.synchro.net/copyright.html * * Copyright 2009 Rob Swindell - http://www.synchro.net/copyright.html *
* * * *
* This program is free software; you can redistribute it and/or * * This program is free software; you can redistribute it and/or *
* modify it under the terms of the GNU General Public License * * modify it under the terms of the GNU General Public License *
...@@ -132,7 +132,7 @@ void sbbs_t::log(char *str) ...@@ -132,7 +132,7 @@ void sbbs_t::log(char *str)
fprintf(logfile_fp," "); fprintf(logfile_fp," ");
logcol=4; } logcol=4; }
fprintf(logfile_fp,str); fprintf(logfile_fp,str);
if(str[strlen(str)-1]==LF) { if(*lastchar(str)==LF) {
logcol=1; logcol=1;
fflush(logfile_fp); fflush(logfile_fp);
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment