Simplify com_sender().
authorAndre Noll <maan@systemlinux.org>
Sun, 4 Apr 2010 21:21:52 +0000 (23:21 +0200)
committerAndre Noll <maan@systemlinux.org>
Sun, 4 Apr 2010 21:21:52 +0000 (23:21 +0200)
The list of senders is always the same, no need to compute and print
it.

command.c

index 8fdb839..bbe0441 100644 (file)
--- a/command.c
+++ b/command.c
@@ -234,7 +234,7 @@ int com_si(struct rc4_context *rc4c, int argc, __a_unused char * const * argv)
 {
        int i, ret;
        char *ut;
-       char *sender_info = NULL, *sender_list = NULL;
+       char *sender_info = NULL;
 
        if (argc != 1)
                return -E_COMMAND_SYNTAX;
@@ -243,8 +243,6 @@ int com_si(struct rc4_context *rc4c, int argc, __a_unused char * const * argv)
                char *info = senders[i].info();
                sender_info = para_strcat(sender_info, info);
                free(info);
-               sender_list = para_strcat(sender_list, senders[i].name);
-               sender_list = para_strcat(sender_list, " ");
        }
        ut = uptime_str();
        ret = rc4_send_va_buffer(rc4c, "up: %s\nplayed: %u\n"
@@ -253,7 +251,6 @@ int com_si(struct rc4_context *rc4c, int argc, __a_unused char * const * argv)
                "connections (active/accepted/total): %u/%u/%u\n"
                "current loglevel: %s\n"
                "supported audio formats: %s\n"
-               "supported senders: %s\n"
                "%s",
                ut, mmd->num_played,
                (int)getppid(),
@@ -263,12 +260,10 @@ int com_si(struct rc4_context *rc4c, int argc, __a_unused char * const * argv)
                mmd->num_connects,
                conf.loglevel_arg,
                supported_audio_formats(),
-               sender_list,
                sender_info
        );
        mutex_unlock(mmd_mutex);
        free(ut);
-       free(sender_list);
        free(sender_info);
        return ret;
 }