gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r20844 - gnunet/src/datastore


From: gnunet
Subject: [GNUnet-SVN] r20844 - gnunet/src/datastore
Date: Mon, 2 Apr 2012 11:29:26 +0200

Author: grothoff
Date: 2012-04-02 11:29:26 +0200 (Mon, 02 Apr 2012)
New Revision: 20844

Modified:
   gnunet/src/datastore/Makefile.am
   gnunet/src/datastore/plugin_datastore_postgres.c
Log:
-fix

Modified: gnunet/src/datastore/Makefile.am
===================================================================
--- gnunet/src/datastore/Makefile.am    2012-04-02 09:27:26 UTC (rev 20843)
+++ gnunet/src/datastore/Makefile.am    2012-04-02 09:29:26 UTC (rev 20844)
@@ -112,6 +112,7 @@
   plugin_datastore_postgres.c
 libgnunet_plugin_datastore_postgres_la_LIBADD = \
   $(top_builddir)/src/statistics/libgnunetstatistics.la \
+  $(top_builddir)/src/postgres/libgnunetpostgres.la \
   $(top_builddir)/src/util/libgnunetutil.la $(XLIBS) -lpq
 libgnunet_plugin_datastore_postgres_la_LDFLAGS = \
  $(GN_PLUGIN_LDFLAGS) $(POSTGRES_LDFLAGS) -lpq

Modified: gnunet/src/datastore/plugin_datastore_postgres.c
===================================================================
--- gnunet/src/datastore/plugin_datastore_postgres.c    2012-04-02 09:27:26 UTC 
(rev 20843)
+++ gnunet/src/datastore/plugin_datastore_postgres.c    2012-04-02 09:29:26 UTC 
(rev 20844)
@@ -236,13 +236,18 @@
   {
     return 0;
   }
-  if ((PQntuples (ret) != 1) || (PQnfields (ret) != 1) ||
-      (PQgetlength (ret, 0, 0) != sizeof (unsigned long long)))
+  if ((PQntuples (ret) != 1) || (PQnfields (ret) != 1) )
   {
     GNUNET_break (0);
     PQclear (ret);
     return 0;
   }
+  if (PQgetlength (ret, 0, 0) != sizeof (unsigned long long))
+  {
+    GNUNET_break (0 == PQgetlength (ret, 0, 0));
+    PQclear (ret);
+    return 0;
+  }
   total = GNUNET_ntohll (*(const unsigned long long *) PQgetvalue (ret, 0, 0));
   PQclear (ret);
   return total;




reply via email to

[Prev in Thread] Current Thread [Next in Thread]