commit 443a687b65c37d9a670058d3e04b9d36ae0354b5
parent 7aed59a60b535fbacdd6ba10da851b59f1a45927
Author: Christian Grothoff <christian@grothoff.org>
Date: Thu, 2 Jul 2026 10:35:22 +0200
-NULL not allowed
Diffstat:
3 files changed, 18 insertions(+), 25 deletions(-)
diff --git a/src/backenddb/lookup_template.c b/src/backenddb/lookup_template.c
@@ -24,16 +24,6 @@
#include "helper.h"
-/**
- * Lookup details about a particular template.
- *
- * @param pg database context
- * @param instance_id instance to lookup template for
- * @param template_id template to lookup
- * @param[out] td set to the template details on success, can be NULL
- * (in that case we only want to check if the template exists)
- * @return database result code
- */
enum GNUNET_DB_QueryStatus
TALER_MERCHANTDB_lookup_template (
struct TALER_MERCHANTDB_PostgresContext *pg,
diff --git a/src/backenddb/test_merchantdb.c b/src/backenddb/test_merchantdb.c
@@ -6313,15 +6313,19 @@ run_test_templates (struct TestTemplates_Closure *cls)
TEST_RET_ON_FAIL (test_lookup_template (&cls->instance,
&cls->templates[0]));
/* Make sure it fails correctly for templates that don't exist */
- if (GNUNET_DB_STATUS_SUCCESS_NO_RESULTS !=
- TALER_MERCHANTDB_lookup_template (pg,
- cls->instance.instance.id,
- "nonexistent_template",
- NULL))
{
- GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
- "Lookup template failed\n");
- return 1;
+ struct TALER_MERCHANTDB_TemplateDetails tx;
+
+ if (GNUNET_DB_STATUS_SUCCESS_NO_RESULTS !=
+ TALER_MERCHANTDB_lookup_template (pg,
+ cls->instance.instance.id,
+ "nonexistent_template",
+ &tx))
+ {
+ GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+ "Lookup template failed\n");
+ return 1;
+ }
}
/* Test template update */
cls->templates[0].template.template_description =
diff --git a/src/include/merchant-database/lookup_template.h b/src/include/merchant-database/lookup_template.h
@@ -26,22 +26,21 @@
#include "merchantdb_lib.h"
-struct TALER_MERCHANTDB_PostgresContext;
/**
* Lookup details about a particular template.
*
* @param pg database context
* @param instance_id instance to lookup template for
* @param template_id template to lookup
- * @param[out] td set to the template details on success, can be NULL
- * (in that case we only want to check if the template exists)
+ * @param[out] td set to the template details on success
* @return database result code
*/
enum GNUNET_DB_QueryStatus
-TALER_MERCHANTDB_lookup_template (struct TALER_MERCHANTDB_PostgresContext *pg,
- const char *instance_id,
- const char *template_id,
- struct TALER_MERCHANTDB_TemplateDetails *td);
+TALER_MERCHANTDB_lookup_template (
+ struct TALER_MERCHANTDB_PostgresContext *pg,
+ const char *instance_id,
+ const char *template_id,
+ struct TALER_MERCHANTDB_TemplateDetails *td);
#endif