[tracker/binary-log] Added 0xff to the memsets to zero out the other bytes



commit fccc5bbba896b7251737e6b60414b1a26420cc74
Author: Philip Van Hoof <philip codeminded be>
Date:   Tue Dec 29 17:36:14 2009 +0100

    Added 0xff to the memsets to zero out the other bytes
    
    Feel free to squash this commit

 src/libtracker-db/tracker-db-journal.c |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)
---
diff --git a/src/libtracker-db/tracker-db-journal.c b/src/libtracker-db/tracker-db-journal.c
index 8fcf10b..839ff6e 100644
--- a/src/libtracker-db/tracker-db-journal.c
+++ b/src/libtracker-db/tracker-db-journal.c
@@ -154,10 +154,10 @@ tracker_db_journal_start_transaction (void)
 static void
 cur_setnum (gchar *dest, guint *pos, guint32 val)
 {
-	memset (dest + (*pos)++, val >> 24, 1);
-	memset (dest + (*pos)++, val >> 16, 1);
-	memset (dest + (*pos)++, val >>  8, 1);
-	memset (dest + (*pos)++, val >>  0, 1);
+	memset (dest + (*pos)++, val >> 24 & 0xff, 1);
+	memset (dest + (*pos)++, val >> 16 & 0xff, 1);
+	memset (dest + (*pos)++, val >>  8 & 0xff, 1);
+	memset (dest + (*pos)++, val >>  0 & 0xff, 1);
 }
 
 static void
@@ -165,7 +165,7 @@ cur_setstr (gchar *dest, guint *pos, const gchar *str, gsize len)
 {
 	memcpy (dest + *pos, str, len);
 	(*pos) += len;
-	memset (dest + (*pos)++, 0, 1);
+	memset (dest + (*pos)++, 0 & 0xff, 1);
 }
 
 void



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