- coverity
[oweals/gnunet.git] / src / namestore / gnunet-namestore.c
index bd083470eef2afd42a84d2013f977afb6fae15da..67464467613e49267ac3a8e4caa391647e1620e3 100644 (file)
@@ -41,7 +41,7 @@ static struct GNUNET_NAMESTORE_Handle *ns;
 /**
  * Hash of the public key of our zone.
  */
-static GNUNET_HashCode zone;
+static struct GNUNET_CRYPTO_ShortHashCode zone;
 
 /**
  * Private key for the our zone.
@@ -292,7 +292,7 @@ run (void *cls, char *const *args, const char *cfgfile,
   }
   GNUNET_CRYPTO_rsa_key_get_public (zone_pkey,
                                    &pub);
-  GNUNET_CRYPTO_hash (&pub, sizeof (pub), &zone);
+  GNUNET_CRYPTO_short_hash (&pub, sizeof (pub), &zone);
 
   ns = GNUNET_NAMESTORE_connect (cfg);
   if (NULL == ns)
@@ -355,11 +355,11 @@ run (void *cls, char *const *args, const char *cfgfile,
       GNUNET_SCHEDULER_shutdown ();
       return;     
     }
-  } else if (add | del)
+  } else if (add)
   {
     fprintf (stderr,
             _("Missing option `%s' for operation `%s'\n"),
-            "-e", _("add/del"));
+            "-e", _("add"));
     GNUNET_SCHEDULER_shutdown ();
     return;     
   }
@@ -377,7 +377,7 @@ run (void *cls, char *const *args, const char *cfgfile,
     rd.data_size = data_size;
     rd.record_type = type;
     rd.expiration = GNUNET_TIME_relative_to_absolute (etime);
-    rd.flags = GNUNET_NAMESTORE_RF_AUTHORITY; // FIXME: not always...
+    rd.flags = GNUNET_NAMESTORE_RF_AUTHORITY;
     add_qe = GNUNET_NAMESTORE_record_create (ns,
                                             zone_pkey,
                                             name,
@@ -398,8 +398,8 @@ run (void *cls, char *const *args, const char *cfgfile,
     rd.data = data;
     rd.data_size = data_size;
     rd.record_type = type;
-    rd.expiration = GNUNET_TIME_relative_to_absolute (etime);
-    rd.flags = GNUNET_NAMESTORE_RF_AUTHORITY; // FIXME: not always...
+    rd.expiration.abs_value = 0;
+    rd.flags = GNUNET_NAMESTORE_RF_AUTHORITY;
     del_qe = GNUNET_NAMESTORE_record_remove (ns,
                                             zone_pkey,
                                             name,