fmlib: Fix uninitialized data in tuner_open().
authorBen Pfaff <blp@cs.stanford.edu>
Sun, 20 Dec 2009 04:42:18 +0000 (19 20:42 -0800)
committerBen Pfaff <blp@cs.stanford.edu>
Sun, 20 Dec 2009 04:42:18 +0000 (19 20:42 -0800)
This is necessary to make fm and fmscan work other than in "test" mode
(for the testsuite).

fmlib.c

diff --git a/fmlib.c b/fmlib.c
index 7cc56bd..669cab3 100644 (file)
--- a/fmlib.c
+++ b/fmlib.c
@@ -70,6 +70,8 @@ xmalloc(size_t n)
 void
 tuner_open(struct tuner *tuner, const char *device, int index)
 {
+        memset(tuner, 0, sizeof *tuner);
+
         if (!device)
                 device = "/dev/radio0";
         else if (!strcmp(device, "test") || !strncmp(device, "test ", 5)) {