]> git.alsa-project.org Git - alsa-utils.git/commitdiff
aplay/arecord: term_c_lflag variable might be unitialized in some cases
authorJaroslav Kysela <perex@perex.cz>
Wed, 18 Aug 2010 06:23:09 +0000 (08:23 +0200)
committerJaroslav Kysela <perex@perex.cz>
Wed, 18 Aug 2010 06:23:09 +0000 (08:23 +0200)
The term_c_lflag variable might be unitialized in some cases. Add extra
check to avoid setting of wrong value.

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
aplay/aplay.c

index a92ca93b7431cc5a103dca8d0d2cf85088e3dd94..c09f23c0ef28b408b8fa2fcfdf63ade05bf9ce32 100644 (file)
@@ -117,7 +117,7 @@ static long long max_file_size = 0;
 static int max_file_time = 0;
 static int use_strftime = 0;
 volatile static int recycle_capture_file = 0;
-static long term_c_lflag = 0;
+static long term_c_lflag = -1;
 
 static int fd = -1;
 static off64_t pbrec_count = LLONG_MAX, fdcount;
@@ -1221,7 +1221,7 @@ static void done_stdin(void)
 {
        struct termios term;
 
-       if (fd == fileno(stdin))
+       if (fd == fileno(stdin) || term_c_lflag == -1)
                return;
        tcgetattr(fileno(stdin), &term);
        term.c_lflag = term_c_lflag;