[tracker/binary-log-2: 23/42] libtracker-db: Fix end of transaction handling when reading journal



commit 61e4f5bb4472cda6e43beba33a36d6560791503c
Author: Jürg Billeter <j bitron ch>
Date:   Wed Jan 6 15:06:23 2010 +0100

    libtracker-db: Fix end of transaction handling when reading journal

 src/libtracker-db/tracker-db-journal.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)
---
diff --git a/src/libtracker-db/tracker-db-journal.c b/src/libtracker-db/tracker-db-journal.c
index d9f5a2d..1469ecf 100644
--- a/src/libtracker-db/tracker-db-journal.c
+++ b/src/libtracker-db/tracker-db-journal.c
@@ -726,11 +726,12 @@ tracker_db_journal_reader_next (GError **error)
 	} else if (reader.amount_of_triples == 0) {
 		/* end of transaction */
 
-		if (reader.current + 4 != reader.entry_end) {
+		reader.current += 4;
+		if (reader.current != reader.entry_end) {
 			/* damaged journal entry */
 			g_set_error (error, TRACKER_DB_JOURNAL_ERROR, 0, 
 			             "Damaged journal entry, %p != %p (end of transaction with 0 triples)",
-			             reader.current + 4,
+			             reader.current,
 			             reader.entry_end);
 			return FALSE;
 		}



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]