diff options
author | Jaroslav Kysela <perex@perex.cz> | 2010-08-18 08:23:09 +0200 |
---|---|---|
committer | Jaroslav Kysela <perex@perex.cz> | 2010-08-18 08:23:09 +0200 |
commit | bb865dc10b6dcee9d428d3c5a17ee312e0aaf7e0 (patch) | |
tree | 05e47965179fa66e063671e33a0bfb50998affaf /aplay | |
parent | 4c337275d1cc0579cc8ad45b4c138287e8658f0d (diff) | |
download | alsa-utils-bb865dc10b6dcee9d428d3c5a17ee312e0aaf7e0.tar.gz |
aplay/arecord: term_c_lflag variable might be unitialized in some cases
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>
Diffstat (limited to 'aplay')
-rw-r--r-- | aplay/aplay.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/aplay/aplay.c b/aplay/aplay.c index a92ca93..c09f23c 100644 --- a/aplay/aplay.c +++ b/aplay/aplay.c @@ -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; |