Correcting a "small" bug in SyncCore
diff --git a/src/sync-core.cc b/src/sync-core.cc
index 4486532..67e2f73 100644
--- a/src/sync-core.cc
+++ b/src/sync-core.cc
@@ -27,11 +27,12 @@
 
 SyncCore::SyncCore(const string &path, const Name &userName, const Name &localPrefix, const Name &syncPrefix, const StateMsgCallback &callback, CcnxWrapperPtr handle, SchedulerPtr scheduler)
          : m_log(path, userName.toString())
+         , m_scheduler(scheduler)
+         , m_stateMsgCallback(callback)
+         , m_userName(userName)
          , m_localPrefix(localPrefix)
          , m_syncPrefix(syncPrefix)
-         , m_stateMsgCallback(callback)
          , m_handle(handle)
-         , m_scheduler(scheduler)
 {
   m_rootHash = m_log.RememberStateInStateLog();
   m_syncClosure = new Closure(0, boost::bind(&SyncCore::handleSyncData, this, _1, _2), boost::bind(&SyncCore::handleSyncInterestTimeout, this, _1));
@@ -81,6 +82,7 @@
 void
 SyncCore::updateLocalState(sqlite3_int64 seqno)
 {
+  cout << "User name: " << m_userName << endl;
   m_log.UpdateDeviceSeqNo(m_userName, seqno);
   // choose to update locator everytime
   m_log.UpdateLocator(m_userName, m_localPrefix);
diff --git a/src/sync-log.cc b/src/sync-log.cc
index f3ba3d0..90f5ba1 100644
--- a/src/sync-log.cc
+++ b/src/sync-log.cc
@@ -288,6 +288,11 @@
   return FindStateDifferences (*Hash::FromString (oldHash), *Hash::FromString (newHash));
 }
 
+// void xTrace (void*, const char* q)
+// {
+//   cout << q << endl;
+// }
+
 SyncStateMsgPtr
 SyncLog::FindStateDifferences (const Hash &oldHash, const Hash &newHash)
 {
@@ -342,17 +347,21 @@
   res += sqlite3_bind_blob  (stmt, 2, newHash.GetHash (), newHash.GetHashBytes (), SQLITE_STATIC);
 
   SyncStateMsgPtr msg = make_shared<SyncStateMsg> ();
+
+  // sqlite3_trace(m_db, xTrace, NULL);
   
   while (sqlite3_step (stmt) == SQLITE_ROW)
     {
       SyncState *state = msg->add_state ();
 
-      state->set_name (reinterpret_cast<const char*> (sqlite3_column_blob (stmt, 0), sqlite3_column_bytes (stmt, 0)));
+      cout << "Bytes: " << sqlite3_column_bytes (stmt, 0)  << endl;
+      cout << "Pointer: " << sqlite3_column_blob (stmt, 0) << endl;
+      state->set_name (reinterpret_cast<const char*> (sqlite3_column_blob (stmt, 0)), sqlite3_column_bytes (stmt, 0));
 
       // locator is optional, so must check if it is null
       if (sqlite3_column_type(stmt, 1) == SQLITE_BLOB)
       {
-        state->set_locator (reinterpret_cast<const char*> (sqlite3_column_blob (stmt, 1), sqlite3_column_bytes (stmt, 1)));
+        state->set_locator (reinterpret_cast<const char*> (sqlite3_column_blob (stmt, 1)), sqlite3_column_bytes (stmt, 1));
       }
 
       sqlite3_int64 newSeqNo = sqlite3_column_int64 (stmt, 3);
@@ -371,5 +380,7 @@
     }
   sqlite3_finalize (stmt);
 
+  // sqlite3_trace(m_db, NULL, NULL);
+
   return msg;
 }