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

index 480c25ce92732bf983d095a480ee3c218fef12e5..9b0ceb1e38c67e291dc9825f0a6a175d0a8d1765 100644 (file)
@@ -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.