From: Phil Mayers
Date: Fri, 21 Sep 2012 14:41:23 +0000 (+0100)
Subject: fix cache_xlat function prototype and remove cast so compiler can detect errors
X-Git-Tag: release_3_0_0_beta1~1662^2~1^2~13
X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=01d3092fa507fc467edccc91ad165287e6a7b528;p=thirdparty%2Ffreeradius-server.git
fix cache_xlat function prototype and remove cast so compiler can detect errors
---
diff --git a/src/modules/rlm_cache/rlm_cache.c b/src/modules/rlm_cache/rlm_cache.c
index e3923a16da8..7ab428e3c45 100644
--- a/src/modules/rlm_cache/rlm_cache.c
+++ b/src/modules/rlm_cache/rlm_cache.c
@@ -361,8 +361,8 @@ static int cache_verify(rlm_cache_t *inst)
/*
* Allow single attribute values to be retrieved from the cache.
*/
-static int cache_xlat(void *instance, REQUEST *request,
- char *fmt, char *out, size_t freespace,
+static size_t cache_xlat(void *instance, REQUEST *request,
+ const char *fmt, char *out, size_t freespace,
UNUSED RADIUS_ESCAPE_STRING func)
{
rlm_cache_entry_t *c;
@@ -500,7 +500,7 @@ static int cache_instantiate(CONF_SECTION *conf, void **instance)
* Register the cache xlat function
*/
inst->xlat_name = strdup(xlat_name);
- xlat_register(xlat_name, (RAD_XLAT_FUNC)cache_xlat, inst);
+ xlat_register(xlat_name, cache_xlat, inst);
if (!inst->key || !*inst->key) {
radlog(L_ERR, "rlm_cache: You must specify a key");