From: Phil Mayers
Date: Fri, 21 Sep 2012 14:41:00 +0000 (+0100)
Subject: fix sql_xlat function prototype and remove cast so compiler can detect errors
X-Git-Tag: release_3_0_0_beta1~1662^2~1^2~14
X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1c907f6eee9dc216ba878ae830d745496e6a75ad;p=thirdparty%2Ffreeradius-server.git
fix sql_xlat function prototype and remove cast so compiler can detect errors
---
diff --git a/src/modules/rlm_sql/rlm_sql.c b/src/modules/rlm_sql/rlm_sql.c
index 480c25ce927..9b0ceb1e38c 100644
--- a/src/modules/rlm_sql/rlm_sql.c
+++ b/src/modules/rlm_sql/rlm_sql.c
@@ -134,8 +134,8 @@ static size_t sql_escape_func(char *out, size_t outlen, const char *in);
* for inserts, updates and deletes the number of rows afftected will be
* returned instead.
*/
-static int sql_xlat(void *instance, REQUEST *request,
- char *fmt, char *out, size_t freespace,
+static size_t sql_xlat(void *instance, REQUEST *request,
+ const char *fmt, char *out, size_t freespace,
UNUSED RADIUS_ESCAPE_STRING func)
{
SQLSOCK *sqlsocket;
@@ -784,7 +784,7 @@ static int rlm_sql_detach(void *instance)
if (inst->pool) sql_poolfree(inst);
if (inst->config->xlat_name) {
- xlat_unregister(inst->config->xlat_name,(RAD_XLAT_FUNC)sql_xlat, instance);
+ xlat_unregister(inst->config->xlat_name, sql_xlat, instance);
free(inst->config->xlat_name);
}
@@ -942,7 +942,7 @@ static int rlm_sql_instantiate(CONF_SECTION * conf, void **instance)
* Register the SQL xlat function
*/
inst->config->xlat_name = strdup(xlat_name);
- xlat_register(xlat_name, (RAD_XLAT_FUNC)sql_xlat, inst);
+ xlat_register(xlat_name, sql_xlat, inst);
/*
* Sanity check for crazy people.