- fix use of uninitialized memory
[oweals/gnunet.git] / src / namecache / plugin_namecache_postgres.c
index 72cfcf243dc75d9563709c41b0b9f4703c18e657..5f0bbb4fd8cd9e1940b57f3a558722353fbb434c 100644 (file)
@@ -1,6 +1,6 @@
  /*
   * This file is part of GNUnet
-  * (C) 2009-2013 Christian Grothoff (and other contributing authors)
+  * Copyright (C) 2009-2013 Christian Grothoff (and other contributing authors)
   *
   * GNUnet is free software; you can redistribute it and/or modify
   * it under the terms of the GNU General Public License as published
@@ -14,8 +14,8 @@
   *
   * You should have received a copy of the GNU General Public License
   * along with GNUnet; see the file COPYING.  If not, write to the
-  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-  * Boston, MA 02111-1307, USA.
+  * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+  * Boston, MA 02110-1301, USA.
   */
 
 /**
@@ -211,10 +211,9 @@ namecache_postgres_expire_blocks (struct Plugin *plugin)
 /**
  * Delete older block in the datastore.
  *
- * @param the plugin
+ * @param plugin the plugin
  * @param query query for the block
- * @param expiration time how old does the block have to be for deletion
- * @return #GNUNET_OK on success, else #GNUNET_SYSERR
+ * @param expiration_time how old does the block have to be for deletion
  */
 static void
 delete_old_block (struct Plugin *plugin,
@@ -255,7 +254,7 @@ delete_old_block (struct Plugin *plugin,
  */
 static int
 namecache_postgres_cache_block (void *cls,
-                                const struct GNUNET_NAMESTORE_Block *block)
+                                const struct GNUNET_GNSRECORD_Block *block)
 {
   struct Plugin *plugin = cls;
   struct GNUNET_HashCode query;
@@ -327,7 +326,7 @@ namecache_postgres_lookup_block (void *cls,
   PGresult *res;
   unsigned int cnt;
   size_t bsize;
-  const struct GNUNET_NAMESTORE_Block *block;
+  const struct GNUNET_GNSRECORD_Block *block;
 
   res = PQexecPrepared (plugin->dbh,
                         "lookup_block", 1,
@@ -353,7 +352,7 @@ namecache_postgres_lookup_block (void *cls,
   GNUNET_assert (1 == cnt);
   GNUNET_assert (1 != PQnfields (res));
   bsize = PQgetlength (res, 0, 0);
-  block = (const struct GNUNET_NAMESTORE_Block *) PQgetvalue (res, 0, 0);
+  block = (const struct GNUNET_GNSRECORD_Block *) PQgetvalue (res, 0, 0);
   if ( (bsize < sizeof (*block)) ||
        (bsize != ntohl (block->purpose.size) +
         sizeof (struct GNUNET_CRYPTO_EcdsaPublicKey) +