mirror of
https://github.com/bluekitchen/btstack.git
synced 2025-02-05 18:40:27 +00:00
daemon examples: avaid compile warning
This commit is contained in:
parent
04e44aa625
commit
cb93c223bc
@ -136,7 +136,9 @@ void packet_handler(uint8_t packet_type, uint16_t channel, uint8_t *packet, uint
|
|||||||
case HCI_EVENT_PIN_CODE_REQUEST:
|
case HCI_EVENT_PIN_CODE_REQUEST:
|
||||||
// inform about pin code request
|
// inform about pin code request
|
||||||
printf("Please enter PIN here: ");
|
printf("Please enter PIN here: ");
|
||||||
fgets(pin, 20, stdin);
|
// avoid -Wunused-result
|
||||||
|
char* res = fgets(pin, 20, stdin);
|
||||||
|
UNUSED(res);
|
||||||
i = strlen(pin)-1;
|
i = strlen(pin)-1;
|
||||||
if( pin[i] == '\n') {
|
if( pin[i] == '\n') {
|
||||||
pin[i] = '\0';
|
pin[i] = '\0';
|
||||||
|
@ -150,7 +150,9 @@ void packet_handler(uint8_t packet_type, uint16_t channel, uint8_t *packet, uint
|
|||||||
case HCI_EVENT_PIN_CODE_REQUEST:
|
case HCI_EVENT_PIN_CODE_REQUEST:
|
||||||
// inform about pin code request
|
// inform about pin code request
|
||||||
printf("Please enter PIN here: ");
|
printf("Please enter PIN here: ");
|
||||||
fgets(pin, 20, stdin);
|
// avoid -Wunused-result
|
||||||
|
char* res = fgets(pin, 20, stdin);
|
||||||
|
UNUSED(res);
|
||||||
i = strlen(pin);
|
i = strlen(pin);
|
||||||
if( pin[i-1] == '\n' || pin[i-1] == '\r') {
|
if( pin[i-1] == '\n' || pin[i-1] == '\r') {
|
||||||
pin[i-1] = '\0';
|
pin[i-1] = '\0';
|
||||||
|
Loading…
x
Reference in New Issue
Block a user