Skip to content

Commit

Permalink
Warning fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
lucaderi committed Apr 5, 2021
1 parent 23c18e3 commit aa18bd3
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions src/sn_selection.c
Original file line number Diff line number Diff line change
Expand Up @@ -159,19 +159,17 @@ SN_SELECTION_CRITERION_DATA_TYPE sn_selection_criterion_gather_data (n2n_sn_t *s
extern char * sn_selection_criterion_str (selection_criterion_str_t out, peer_info_t *peer) {

if(NULL == out) {
return NULL;
return NULL;
}
memset(out, 0, SN_SELECTION_CRITERION_BUF_SIZE);


if(peer->selection_criterion > 0) {
#ifndef SN_SELECTION_RTT
snprintf(out, SN_SELECTION_CRITERION_BUF_SIZE,
(int16_t)(peer->selection_criterion) >= 0 ? "load = %8d" :
"", peer->selection_criterion);
snprintf(out, SN_SELECTION_CRITERION_BUF_SIZE, "load = %8d", peer->selection_criterion);
#else
snprintf(out, SN_SELECTION_CRITERION_BUF_SIZE,
(int16_t)(peer->selection_criterion) >= 0 ? "rtt = %6d ms" :
"", peer->selection_criterion);
snprintf(out, SN_SELECTION_CRITERION_BUF_SIZE, "rtt = %6d ms", peer->selection_criterion);
#endif
}

return out;
}

0 comments on commit aa18bd3

Please sign in to comment.