From 3095c816e23acc3565ec7cc4c8c115dc2b4c0855 Mon Sep 17 00:00:00 2001 From: Luca Deri Date: Tue, 20 Oct 2020 17:17:17 +0200 Subject: [PATCH] Warnign fixes --- src/sn.c | 8 ++------ tools/benchmark.c | 2 +- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/src/sn.c b/src/sn.c index 9124e0e..29c75f7 100644 --- a/src/sn.c +++ b/src/sn.c @@ -329,12 +329,8 @@ static int setOption(int optkey, char *_optarg, n2n_sn_t *sss) { #endif case 'F': { /* federation name */ - - if(sss->federation->community != NULL){ - snprintf(sss->federation->community,N2N_COMMUNITY_SIZE-1,"*%s",_optarg); - sss->federation->community[N2N_COMMUNITY_SIZE-1] = '\0'; - } - + snprintf(sss->federation->community, N2N_COMMUNITY_SIZE-1, "*%s" ,_optarg); + sss->federation->community[N2N_COMMUNITY_SIZE-1] = '\0'; break; } diff --git a/tools/benchmark.c b/tools/benchmark.c index 230b2b0..2230876 100644 --- a/tools/benchmark.c +++ b/tools/benchmark.c @@ -150,7 +150,7 @@ static void run_compression_benchmark() { gettimeofday( &t1, NULL ); while(tdiff < target_usec) { compression_len = N2N_PKT_BUF_SIZE; - if(!lzo1x_1_compress(PKT_CONTENT, sizeof(PKT_CONTENT), compression_buffer, &compression_len, wrkmem) == LZO_E_OK) { + if(lzo1x_1_compress(PKT_CONTENT, sizeof(PKT_CONTENT), compression_buffer, &compression_len, wrkmem) != LZO_E_OK) { printf("\n\t compression error\n"); exit(1); }