fix partial log output bug

This commit is contained in:
Glenn Maynard
2003-08-19 02:19:17 +00:00
parent f754f4259b
commit 400c99f8dc
+4
View File
@@ -303,8 +303,12 @@ const char *RageLog::GetRecentLog( int n )
{ {
if( n >= BACKLOG_LINES || n >= backlog_cnt ) if( n >= BACKLOG_LINES || n >= backlog_cnt )
return false; return false;
if( backlog_cnt == BACKLOG_LINES )
{
n += backlog_start; n += backlog_start;
n %= BACKLOG_LINES; n %= BACKLOG_LINES;
}
/* Make sure it's terminated: */ /* Make sure it's terminated: */
backlog[n][ sizeof(backlog[n])-1 ] = 0; backlog[n][ sizeof(backlog[n])-1 ] = 0;