author | tille <tille> | 2002-05-15 09:53:39 (UTC) |
---|---|---|
committer | tille <tille> | 2002-05-15 09:53:39 (UTC) |
commit | 7977d9c5793100040b645974be1573572a550f62 (patch) (side-by-side diff) | |
tree | bd1265a21c2ea7495fa0e9446e80239e25c5aeed | |
parent | b1198cf567577dba9710b9fb19d924c766202c38 (diff) | |
download | opie-7977d9c5793100040b645974be1573572a550f62.zip opie-7977d9c5793100040b645974be1573572a550f62.tar.gz opie-7977d9c5793100040b645974be1573572a550f62.tar.bz2 |
hack to get rig of segfaults after reading </DATEBOOK>
-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 @@ -732,9 +732,10 @@ void DateBookDB::loadFile( const QString &strFile ) origHadRepeat; // should be bool, but we need tri-state(not being used) int i = 0; char *point; - while ( ( point = strstr( dt+i, "<event " ) ) != 0 ) { + // hack to get rid of segfaults after reading </DATEBOOK> + while ( (dt+i != 0) && (( point = strstr( dt+i, "<event " ) ) != 0 )) { i = point - dt; // if we are reading in events in the general case, // we are just adding them, so let the actions represent that... currentAction = ACTION_ADD; |