mirror of
https://github.com/alsa-project/alsa-utils
synced 2024-12-22 23:16:32 +01:00
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>
This commit is contained in:
parent
4c337275d1
commit
bb865dc10b
1 changed files with 2 additions and 2 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue