spa: small cleanups

Initialize result variable.
Use strncpy to avoid warnings about using non-NULL terminaded strings.
This commit is contained in:
Wim Taymans 2024-01-10 15:51:01 +01:00
parent 15908328d1
commit d0a2e6316b
7 changed files with 9 additions and 9 deletions

View file

@ -663,7 +663,7 @@ static inline int32_t netjack2_driver_sync_wait(struct netjack2_peer *peer)
if (len >= (ssize_t)sizeof(sync)) {
//nj2_dump_packet_header(&sync);
if (strcmp(sync.type, "header") == 0 &&
if (strncmp(sync.type, "header", sizeof(sync.type)) == 0 &&
ntohl(sync.data_type) == 's' &&
ntohl(sync.data_stream) == peer->other_stream &&
ntohl(sync.id) == peer->params.id)
@ -695,7 +695,7 @@ static inline int32_t netjack2_manager_sync_wait(struct netjack2_peer *peer)
if (len >= (ssize_t)sizeof(sync)) {
//nj2_dump_packet_header(sync);
if (strcmp(sync.type, "header") == 0 &&
if (strncmp(sync.type, "header", sizeof(sync.type)) == 0 &&
ntohl(sync.data_type) == 's' &&
ntohl(sync.data_stream) == peer->other_stream &&
ntohl(sync.id) == peer->params.id)