aboutsummaryrefslogtreecommitdiffhomepage
path: root/backends
diff options
context:
space:
mode:
authorcbdev <cb@cbcdn.com>2021-01-15 23:49:12 +0100
committercbdev <cb@cbcdn.com>2021-01-15 23:49:12 +0100
commit71d86ec46259ce1b5488989ec30152c7cf810a8e (patch)
treebd76e526c90ef44b8983383b6394d440a5889561 /backends
parent297f11b98a6d7aec59eedd319d3056262a4a8b33 (diff)
downloadmidimonster-71d86ec46259ce1b5488989ec30152c7cf810a8e.tar.gz
midimonster-71d86ec46259ce1b5488989ec30152c7cf810a8e.tar.bz2
midimonster-71d86ec46259ce1b5488989ec30152c7cf810a8e.zip
Fix static analysis failures
Diffstat (limited to 'backends')
-rw-r--r--backends/rtpmidi.c7
-rw-r--r--backends/visca.h3
2 files changed, 6 insertions, 4 deletions
diff --git a/backends/rtpmidi.c b/backends/rtpmidi.c
index 3a54e26..f0987f2 100644
--- a/backends/rtpmidi.c
+++ b/backends/rtpmidi.c
@@ -783,10 +783,9 @@ static int rtpmidi_set(instance* inst, size_t num, channel** c, channel_value* v
uint8_t frame[RTPMIDI_PACKET_BUFFER] = "";
rtpmidi_header* rtp_header = (rtpmidi_header*) frame;
rtpmidi_command_header* command_header = (rtpmidi_command_header*) (frame + sizeof(rtpmidi_header));
- size_t offset = sizeof(rtpmidi_header) + sizeof(rtpmidi_command_header), u = 0;
+ size_t command_length = 0, offset = sizeof(rtpmidi_header) + sizeof(rtpmidi_command_header), u = 0;
uint8_t* payload = frame + offset;
rtpmidi_channel_ident ident;
- size_t command_length = 0;
rtp_header->vpxcc = RTPMIDI_HEADER_MAGIC;
//some receivers seem to have problems reading rfcs and interpreting the marker bit correctly
@@ -845,7 +844,9 @@ static int rtpmidi_set(instance* inst, size_t num, channel** c, channel_value* v
for(u = 0; u < data->peers; u++){
if(data->peer[u].active && data->peer[u].connected){
- sendto(data->fd, frame, offset, 0, (struct sockaddr*) &data->peer[u].dest, data->peer[u].dest_len);
+ if(sendto(data->fd, frame, offset, 0, (struct sockaddr*) &data->peer[u].dest, data->peer[u].dest_len) <= 0){
+ LOGPF("Failed to transmit to peer: %s", mmbackend_socket_strerror(errno));
+ }
}
}
diff --git a/backends/visca.h b/backends/visca.h
index 47ada19..1004076 100644
--- a/backends/visca.h
+++ b/backends/visca.h
@@ -88,5 +88,6 @@ static struct {
[store] = {"store", 7, {0x80, 0x01, 0x04, 0x3F, 0x01, 0, 0xFF}, 0, 254, 0, ptz_set_memory_store},
[home] = {"home", 5, {0x80, 0x01, 0x06, 0x04, 0xFF}, 0, 0, 0, NULL},
[relmove] = {"move", 9, {0x80, 0x01, 0x06, 0x01, 0, 0, 0, 0, 0xFF}, 0, 1, 0, ptz_set_relmove},
- [stop] = {"stop", 9, {0x80, 0x01, 0x06, 0x01, 0, 0, 0x03, 0x03, 0xFF}, 0, 0, 0, ptz_set_relmove}
+ [stop] = {"stop", 9, {0x80, 0x01, 0x06, 0x01, 0, 0, 0x03, 0x03, 0xFF}, 0, 0, 0, ptz_set_relmove},
+ [sentinel] = {"SENTINEL"}
};