mirror of
https://github.com/alsa-project/alsa-lib.git
synced 2025-10-29 05:40:25 -04:00
pcm: dmix - Add error handler for fgets
Fixes: https://github.com/alsa-project/alsa-lib/pull/238 Signed-off-by: Tomohiro IKEDA <rilakkuma.san.xjapan@gmail.com> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
This commit is contained in:
parent
2d56ff8ded
commit
ff0db96bbc
2 changed files with 2 additions and 4 deletions
|
|
@ -104,8 +104,7 @@ static void mix_select_callbacks(snd_pcm_direct_t *dmix)
|
|||
/* try to determine the capabilities of the CPU */
|
||||
in = fopen("/proc/cpuinfo", "r");
|
||||
if (in) {
|
||||
while (!feof(in)) {
|
||||
fgets(line, sizeof(line), in);
|
||||
while (!feof(in) && (fgets(line, sizeof(line), in) != NULL)) {
|
||||
if (!strncmp(line, "processor", 9))
|
||||
smp++;
|
||||
else if (!strncmp(line, "flags", 5)) {
|
||||
|
|
|
|||
|
|
@ -87,8 +87,7 @@ static void mix_select_callbacks(snd_pcm_direct_t *dmix)
|
|||
/* try to determine, if we have SMP */
|
||||
in = fopen("/proc/cpuinfo", "r");
|
||||
if (in) {
|
||||
while (!feof(in)) {
|
||||
fgets(line, sizeof(line), in);
|
||||
while (!feof(in) && (fgets(line, sizeof(line), in) != NULL)) {
|
||||
if (!strncmp(line, "processor", 9))
|
||||
smp++;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue