aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorManuel Bachmann <manuel.bachmann@iot.bzh>2016-02-23 13:15:24 +0100
committerManuel Bachmann <manuel.bachmann@iot.bzh>2016-02-23 13:15:24 +0100
commit623aa9c2f8296adcd3b2aed2c6811927fde3645d (patch)
tree5d33f6b4fde7a9a2f1aaa427bafd3b349be91714
parent6930cdc6c322f88d1f3cc99622941e3d5037f74a (diff)
Fix horrendously wrong Volume check in Audio plugin
Volume bound check was always false. Signed-off-by: Manuel Bachmann <manuel.bachmann@iot.bzh>
-rw-r--r--plugins/audio/audio-api.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/plugins/audio/audio-api.c b/plugins/audio/audio-api.c
index 637f9d03..9c9da251 100644
--- a/plugins/audio/audio-api.c
+++ b/plugins/audio/audio-api.c
@@ -190,7 +190,7 @@ STATIC json_object* volume (AFB_request *request) { /* AFB_SESSION_CHECK */
volume_i = strtok (volume_i, ",");
volume[0] = atoi (volume_i);
- if (100 < volume[0] < 0) {
+ if ((100 < volume[0])||(volume[0] < 0)) {
free (volume_i);
request->errcode = MHD_HTTP_SERVICE_UNAVAILABLE;
return (jsonNewMessage (AFB_FAIL, "Volume must be between 0 and 100"));