mirror of
https://github.com/alsa-project/alsa-lib.git
synced 2025-11-04 13:30:08 -05:00
Fix bugs in perm option
Fixed silly bugs in perm option.
This commit is contained in:
parent
4e1723f9a5
commit
d81d6940ca
1 changed files with 5 additions and 4 deletions
|
|
@ -27,6 +27,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <byteswap.h>
|
#include <byteswap.h>
|
||||||
|
#include <ctype.h>
|
||||||
#include "pcm_local.h"
|
#include "pcm_local.h"
|
||||||
#include "pcm_plugin.h"
|
#include "pcm_plugin.h"
|
||||||
|
|
||||||
|
|
@ -539,18 +540,18 @@ int _snd_pcm_file_open(snd_pcm_t **pcmp, const char *name,
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (strcmp(id, "perm") == 0) {
|
if (strcmp(id, "perm") == 0) {
|
||||||
char *perm;
|
char *str;
|
||||||
char *endp;
|
char *endp;
|
||||||
err = snd_config_get_ascii(n, &perm);
|
err = snd_config_get_ascii(n, &str);
|
||||||
if (err < 0) {
|
if (err < 0) {
|
||||||
SNDERR("The field perm must be a valid file permission");
|
SNDERR("The field perm must be a valid file permission");
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
if (isdigit(*perm) == 0) {
|
if (isdigit(*str) == 0) {
|
||||||
SNDERR("The field perm must be a valid file permission");
|
SNDERR("The field perm must be a valid file permission");
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
perm = strtol(perm, &endp, 8);
|
perm = strtol(str, &endp, 8);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
SNDERR("Unknown field %s", id);
|
SNDERR("Unknown field %s", id);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue