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
{
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;