From cb93c223bc3c718fbf6e414578af3369cbf3345f Mon Sep 17 00:00:00 2001 From: Matthias Ringwald Date: Thu, 8 Nov 2018 08:21:57 +0100 Subject: [PATCH] daemon examples: avaid compile warning --- platform/daemon/example/l2cap_server.c | 4 +++- platform/daemon/example/l2cap_throughput.c | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/platform/daemon/example/l2cap_server.c b/platform/daemon/example/l2cap_server.c index 7ecafc76e..9df9e412f 100644 --- a/platform/daemon/example/l2cap_server.c +++ b/platform/daemon/example/l2cap_server.c @@ -136,7 +136,9 @@ void packet_handler(uint8_t packet_type, uint16_t channel, uint8_t *packet, uint case HCI_EVENT_PIN_CODE_REQUEST: // inform about pin code request printf("Please enter PIN here: "); - fgets(pin, 20, stdin); + // avoid -Wunused-result + char* res = fgets(pin, 20, stdin); + UNUSED(res); i = strlen(pin)-1; if( pin[i] == '\n') { pin[i] = '\0'; diff --git a/platform/daemon/example/l2cap_throughput.c b/platform/daemon/example/l2cap_throughput.c index 50e08d609..ec72683b4 100644 --- a/platform/daemon/example/l2cap_throughput.c +++ b/platform/daemon/example/l2cap_throughput.c @@ -150,7 +150,9 @@ void packet_handler(uint8_t packet_type, uint16_t channel, uint8_t *packet, uint case HCI_EVENT_PIN_CODE_REQUEST: // inform about pin code request printf("Please enter PIN here: "); - fgets(pin, 20, stdin); + // avoid -Wunused-result + char* res = fgets(pin, 20, stdin); + UNUSED(res); i = strlen(pin); if( pin[i-1] == '\n' || pin[i-1] == '\r') { pin[i-1] = '\0';