[Pcsclite-cvs-commit] r6815 - trunk/Drivers/ccid/examples

ludovic.rousseau at free.fr ludovic.rousseau at free.fr
Tue Jan 7 09:52:29 UTC 2014


Author: rousseau
Date: 2014-01-07 09:52:29 +0000 (Tue, 07 Jan 2014)
New Revision: 6815

Modified:
   trunk/Drivers/ccid/examples/scardcontrol.c
Log:
Check value returned by gets(3)

Fix compiler warning:
scardcontrol.c:649:4: warning: ignoring return value of ?\226?\128?\152fgets?\226?\128?\153, declared with attribute warn_unused_result [-Wunused-result]


Modified: trunk/Drivers/ccid/examples/scardcontrol.c
===================================================================
--- trunk/Drivers/ccid/examples/scardcontrol.c	2014-01-07 09:49:47 UTC (rev 6814)
+++ trunk/Drivers/ccid/examples/scardcontrol.c	2014-01-07 09:52:29 UTC (rev 6815)
@@ -646,9 +646,10 @@
 		{
 			/* read the fake digits */
 			char in[40];	/* 4 digits + \n + \0 */
-			(void)fgets(in, sizeof(in), stdin);
+			char *s = fgets(in, sizeof(in), stdin);
 
-			printf("keyboard sent: %s", in);
+			if (s)
+				printf("keyboard sent: %s", in);
 		}
 		else
 			/* if it is not a keyboard */




More information about the Pcsclite-cvs-commit mailing list