Print out debug condition. Fixes #1046
authorAlan T. DeKok <aland@freeradius.org>
Fri, 26 Jun 2015 02:10:43 +0000 (22:10 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Fri, 26 Jun 2015 02:10:43 +0000 (22:10 -0400)
src/main/command.c

index 491232a..0a5f61d 100644 (file)
@@ -1243,7 +1243,7 @@ static int command_debug_condition(rad_listen_t *listener, int argc, char *argv[
         *      Disable it.
         */
        if (argc == 0) {
-               talloc_free(debug_condition);
+               TALLOC_FREE(debug_condition);
                debug_condition = NULL;
                return CMD_OK;
        }
@@ -1317,7 +1317,7 @@ static int command_debug_condition(rad_listen_t *listener, int argc, char *argv[
                ERROR("%s", p);
                ERROR("%s^ %s", spaces, error);
 
-               cprintf(listener, "Parse error in condition \"%s\": %s\n", p, error);
+               cprintf_error(listener, "Parse error in condition \"%s\": %s\n", p, error);
 
                talloc_free(spaces);
                talloc_free(text);
@@ -1330,7 +1330,7 @@ static int command_debug_condition(rad_listen_t *listener, int argc, char *argv[
         *      This is thread-safe because the condition is evaluated
         *      in the main server thread, along with this code.
         */
-       talloc_free(debug_condition);
+       TALLOC_FREE(debug_condition);
        debug_condition = new_condition;
 
        return CMD_OK;
@@ -1341,7 +1341,7 @@ static int command_show_debug_condition(rad_listen_t *listener,
 {
        char buffer[1024];
 
-       if (debug_condition) {
+       if (!debug_condition) {
                cprintf(listener, "\n");
                return CMD_OK;
        }