[libdvdcss-devel] dvd_region: Intentionally discard the return value from getchar()

Diego Biurrun git at videolan.org
Tue Nov 11 15:16:28 CET 2014


libdvdcss | branch: master | Diego Biurrun <diego at biurrun.de> | Thu Nov  6 15:14:35 2014 +0100| [275fdb5bb53c5aad402036ffa9744ad6bca9f13f] | committer: Diego Biurrun

dvd_region: Intentionally discard the return value from getchar()

This fixes CID 75512.

> http://git.videolan.org/gitweb.cgi/libdvdcss.git/?a=commit;h=275fdb5bb53c5aad402036ffa9744ad6bca9f13f
---

 test/dvd_region.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/test/dvd_region.c b/test/dvd_region.c
index 52fcc9d..4a2806f 100644
--- a/test/dvd_region.c
+++ b/test/dvd_region.c
@@ -143,7 +143,8 @@ static int set_region(int fd, int region)
   }
   printf("Setting drive region can only be done a finite " \
          "number of times, press Ctrl-C now to cancel!\n");
-  getchar();
+  /* Discard returned character, just wait for any key as confirmation. */
+  (void) getchar();
 
   region_mask = 0xff & ~(1 << (region - 1));
   printf("Setting region to %d( %x)\n", region, region_mask);



More information about the libdvdcss-devel mailing list