PEERSTORE store function
[oweals/gnunet.git] / src / peerstore / plugin_peerstore_sqlite.c
index 1695938bbb3847b87f8c8fe90d142ae269a241b6..e967e2177021e059f46c8a9559c1787cc2f43be6 100644 (file)
@@ -104,7 +104,7 @@ peerstore_sqlite_store_record (void *cls,
   //FIXME: check if value exists with the same key first
 
   if(SQLITE_OK != sqlite3_bind_blob(stmt, 2, peer, sizeof(struct GNUNET_PeerIdentity), SQLITE_STATIC)
-      || SQLITE_OK != sqlite3_bind_text(stmt, 1, sub_system, sizeof(sub_system), SQLITE_STATIC)
+      || SQLITE_OK != sqlite3_bind_text(stmt, 1, sub_system, strlen(sub_system) + 1, SQLITE_STATIC)
       || SQLITE_OK != sqlite3_bind_blob(stmt, 3, value, size, SQLITE_STATIC))
     LOG_SQLITE (plugin, GNUNET_ERROR_TYPE_ERROR | GNUNET_ERROR_TYPE_BULK,
                     "sqlite3_bind");