From: Andy Green Date: Fri, 4 Aug 2017 05:29:20 +0000 (+0800) Subject: ping test app: avoid FPE when no packets received X-Git-Tag: upstream/2.3.0~9 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=07b444c922e83be7a11d7b3546a65ec8a5b5d910;p=platform%2Fupstream%2Flibwebsockets.git ping test app: avoid FPE when no packets received --- diff --git a/test-server/test-ping.c b/test-server/test-ping.c index f0f00d3d..39177811 100644 --- a/test-server/test-ping.c +++ b/test-server/test-ping.c @@ -536,7 +536,8 @@ int main(int argc, char **argv) /* stats */ - fprintf(stderr, "\n--- %s websocket ping statistics " + if (global_rx_count && global_tx_count) + fprintf(stderr, "\n--- %s websocket ping statistics " "using %d connections ---\n" "%lu packets transmitted, %lu received, " "%lu%% packet loss, time %ldms\n"