-rw-r--r-- | library/datebookdb.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/library/datebookdb.cpp b/library/datebookdb.cpp index 2ac9a0c..a26fe8f 100644 --- a/library/datebookdb.cpp +++ b/library/datebookdb.cpp | |||
@@ -724,25 +724,26 @@ void DateBookDB::loadFile( const QString &strFile ) | |||
724 | dict.insert( "actionorig", new int (FJournalOrigHadRepeat) ); | 724 | dict.insert( "actionorig", new int (FJournalOrigHadRepeat) ); |
725 | 725 | ||
726 | 726 | ||
727 | QByteArray ba = f.readAll(); | 727 | QByteArray ba = f.readAll(); |
728 | char* dt = ba.data(); | 728 | char* dt = ba.data(); |
729 | int len = ba.size(); | 729 | int len = ba.size(); |
730 | int currentAction, | 730 | int currentAction, |
731 | journalKey, | 731 | journalKey, |
732 | origHadRepeat; // should be bool, but we need tri-state(not being used) | 732 | origHadRepeat; // should be bool, but we need tri-state(not being used) |
733 | 733 | ||
734 | int i = 0; | 734 | int i = 0; |
735 | char *point; | 735 | char *point; |
736 | while ( ( point = strstr( dt+i, "<event " ) ) != 0 ) { | 736 | // hack to get rid of segfaults after reading </DATEBOOK> |
737 | while ( (dt+i != 0) && (( point = strstr( dt+i, "<event " ) ) != 0 )) { | ||
737 | i = point - dt; | 738 | i = point - dt; |
738 | // if we are reading in events in the general case, | 739 | // if we are reading in events in the general case, |
739 | // we are just adding them, so let the actions represent that... | 740 | // we are just adding them, so let the actions represent that... |
740 | currentAction = ACTION_ADD; | 741 | currentAction = ACTION_ADD; |
741 | journalKey = -1; | 742 | journalKey = -1; |
742 | origHadRepeat = -1; | 743 | origHadRepeat = -1; |
743 | // some temporary variables for dates and times ... | 744 | // some temporary variables for dates and times ... |
744 | //int startY = 0, startM = 0, startD = 0, starth = 0, startm = 0, starts = 0; | 745 | //int startY = 0, startM = 0, startD = 0, starth = 0, startm = 0, starts = 0; |
745 | //int endY = 0, endM = 0, endD = 0, endh = 0, endm = 0, ends = 0; | 746 | //int endY = 0, endM = 0, endD = 0, endh = 0, endm = 0, ends = 0; |
746 | //int enddtY = 0, enddtM = 0, enddtD = 0; | 747 | //int enddtY = 0, enddtM = 0, enddtD = 0; |
747 | 748 | ||
748 | // ... for the alarm settings ... | 749 | // ... for the alarm settings ... |