sad

simple audio daemon
git clone git://git.2f30.org/sad
Log | Files | Refs | LICENSE

commit 3ad4bb3590b76992d937e4ac30af5ed1d46b0a88
parent 4ec8f73552d94b1a28799a74b8f762d3d96084ca
Author: sin <sin@2f30.org>
Date:   Wed, 14 Jan 2015 19:49:16 +0000

Use else-if as only one of these is possible at a time

Diffstat:
Mcmd.c | 16++++------------
1 file changed, 4 insertions(+), 12 deletions(-)

diff --git a/cmd.c b/cmd.c @@ -26,19 +26,13 @@ cmdstatus(int fd, char *arg) if (!strncmp(arg, "random", 7)) { ok = 1; dprintf(fd, "%d\n", getplaylistmode() & RANDOM == 1); - } - - if (!strncmp(arg, "repeat", 7)) { + } else if (!strncmp(arg, "repeat", 7)) { ok = 1; dprintf(fd, "%d\n", getplaylistmode() & REPEAT == 1); - } - - if (!strncmp(arg, "single", 7)) { + } else if (!strncmp(arg, "single", 7)) { ok = 1; dprintf(fd, "%d\n", getplaylistmode() & SINGLE == 1); - } - - if (!strncmp(arg, "songid", 7)) { + } else if (!strncmp(arg, "songid", 7)) { ok = 1; s = getcursong(); @@ -48,9 +42,7 @@ cmdstatus(int fd, char *arg) } dprintf(fd, "%d\n", s->id); - } - - if (!strncmp(arg, "playback", 9)) { + } else if (!strncmp(arg, "playback", 9)) { ok = 1; s = getcursong();