]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
fix cache_xlat function prototype and remove cast so compiler can detect errors
authorPhil Mayers <p.mayers@imperial.ac.uk>
Fri, 21 Sep 2012 14:41:23 +0000 (15:41 +0100)
committerPhil Mayers <p.mayers@imperial.ac.uk>
Fri, 5 Oct 2012 11:48:43 +0000 (12:48 +0100)
src/modules/rlm_cache/rlm_cache.c

index e3923a16da82211fb42859144241399abcb568e1..7ab428e3c457f3609a0d778b978345703230a4aa 100644 (file)
@@ -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");