summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Günther <tom@toms-cafe.de>2010-03-31 02:31:20 +0200
committerThomas Günther <tom@toms-cafe.de>2010-03-31 02:31:20 +0200
commit792a9e477954373d300e22615126acd8e3d5af7c (patch)
tree00221aaa4a5b8d5e660e4e4dcd10adc6db8697bc
parentaf0346136a10e4cabebfc5ccd2e7899a0ad49a43 (diff)
downloadvdr-plugin-sudoku-792a9e477954373d300e22615126acd8e3d5af7c.tar.gz
vdr-plugin-sudoku-792a9e477954373d300e22615126acd8e3d5af7c.tar.bz2
Fixed segfault in History::current
-rw-r--r--HISTORY1
-rw-r--r--history.cpp6
2 files changed, 5 insertions, 2 deletions
diff --git a/HISTORY b/HISTORY
index 162d282..a4397ba 100644
--- a/HISTORY
+++ b/HISTORY
@@ -96,3 +96,4 @@ ____-__-__: Version 0.3.5
- Removed compatibility to VDR < 1.6.0.
- Converted documentation and source files to UTF-8.
- Added unit tests.
+- Fixed segfault in History::current.
diff --git a/history.cpp b/history.cpp
index 5ed7ec7..d89d0d5 100644
--- a/history.cpp
+++ b/history.cpp
@@ -1,7 +1,7 @@
/*
* Sudoku: A plug-in for the Video Disk Recorder
*
- * Copyright (C) 2008, Thomas Günther <tom@toms-cafe.de>
+ * Copyright (C) 2008-2010, Thomas Günther <tom@toms-cafe.de>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -53,7 +53,9 @@ void History::reset()
/** Current move in the history */
Move* History::current()
{
- return history[executed - 1];
+ if (movesExecuted())
+ return history[executed - 1];
+ return 0;
}
/** Add a new move */