]> git.tuebingen.mpg.de Git - paraslash.git/blobdiff - command.c
mood.c: Avoid integer underflow.
[paraslash.git] / command.c
index 41a58eac0517e15e44c964250578173708289e60..f1f00fca8a29add0e35a2e415a927bdeb75c4376 100644 (file)
--- a/command.c
+++ b/command.c
@@ -156,7 +156,7 @@ static int check_sender_args(int argc, char * const * argv, struct sender_comman
        const char *subcmds[] = {"add", "delete", "allow", "deny", "on", "off", NULL};
 
        scd->sender_num = -1;
-       if (argc < 2)
+       if (argc < 3)
                return -E_COMMAND_SYNTAX;
        for (i = 0; senders[i].name; i++)
                if (!strcmp(senders[i].name, argv[1]))
@@ -439,6 +439,7 @@ static int com_version(struct command_context *cc)
        return sc_send_bin_buffer(&cc->scc, msg, len);
 }
 
+/** These status items are cleared if no audio file is currently open. */
 #define EMPTY_STATUS_ITEMS \
        ITEM(PATH) \
        ITEM(DIRECTORY) \
@@ -465,7 +466,11 @@ static int com_version(struct command_context *cc)
        ITEM(YEAR) \
        ITEM(ALBUM) \
        ITEM(COMMENT) \
-       ITEM(AMPLIFICATION)
+       ITEM(MTIME) \
+       ITEM(FILE_SIZE) \
+       ITEM(CHUNK_TIME) \
+       ITEM(NUM_CHUNKS) \
+       ITEM(AMPLIFICATION) \
 
 /**
  * Write a list of audio-file related status items with empty values.