From 6e321dd8f3af554fd5f670be4c2e96e993e69ad1 Mon Sep 17 00:00:00 2001 From: Alexis Green Date: Mon, 1 Aug 2016 13:03:46 -0700 Subject: [PATCH 1/1] Fixing warning: warning: ignoring return va 'scanf', declared with attribute warn_unused_result [-Wunused-result] --- client/cmdhflegic.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/client/cmdhflegic.c b/client/cmdhflegic.c index ccdfa1da..0adf3c59 100644 --- a/client/cmdhflegic.c +++ b/client/cmdhflegic.c @@ -527,8 +527,7 @@ int CmdLegicRfRawWrite(const char *Cmd) { PrintAndLog("# changing the DCF is irreversible #"); PrintAndLog("#####################################"); PrintAndLog("do youe really want to continue? y(es) n(o)"); - scanf(" %c", &answer); - if (answer == 'y' || answer == 'Y') { + if (scanf(" %c", &answer) > 0 && (answer == 'y' || answer == 'Y')) { SendCommand(&c); return 0; } -- 2.39.2