aboutsummaryrefslogtreecommitdiff
path: root/src/datastore/plugin_datastore_postgres.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/datastore/plugin_datastore_postgres.c')
-rw-r--r--src/datastore/plugin_datastore_postgres.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/datastore/plugin_datastore_postgres.c b/src/datastore/plugin_datastore_postgres.c
index bbbbf9534..6dec3146d 100644
--- a/src/datastore/plugin_datastore_postgres.c
+++ b/src/datastore/plugin_datastore_postgres.c
@@ -236,13 +236,18 @@ postgres_plugin_estimate_size (void *cls)
236 { 236 {
237 return 0; 237 return 0;
238 } 238 }
239 if ((PQntuples (ret) != 1) || (PQnfields (ret) != 1) || 239 if ((PQntuples (ret) != 1) || (PQnfields (ret) != 1) )
240 (PQgetlength (ret, 0, 0) != sizeof (unsigned long long)))
241 { 240 {
242 GNUNET_break (0); 241 GNUNET_break (0);
243 PQclear (ret); 242 PQclear (ret);
244 return 0; 243 return 0;
245 } 244 }
245 if (PQgetlength (ret, 0, 0) != sizeof (unsigned long long))
246 {
247 GNUNET_break (0 == PQgetlength (ret, 0, 0));
248 PQclear (ret);
249 return 0;
250 }
246 total = GNUNET_ntohll (*(const unsigned long long *) PQgetvalue (ret, 0, 0)); 251 total = GNUNET_ntohll (*(const unsigned long long *) PQgetvalue (ret, 0, 0));
247 PQclear (ret); 252 PQclear (ret);
248 return total; 253 return total;