mirror of
https://github.com/alsa-project/alsa-utils
synced 2024-11-08 21:55:42 +01:00
Use ANSI C functions
Replace non-ANSI C functions index() and rindex() with strchr() and strrchr(), respectively. Signed-off-by: Takashi Iwai <tiwai@suse.de>
This commit is contained in:
parent
4d9951ca4e
commit
9662a167d8
1 changed files with 2 additions and 2 deletions
|
@ -381,7 +381,7 @@ static int set_ctl_value(struct space *space, const char *value, int all)
|
|||
snd_ctl_elem_value_set_integer(space->ctl_value, idx, val);
|
||||
} else if (items > 2 && value[items-2] == 'd' && value[items-1] == 'B') {
|
||||
val = strtol(value, NULL, 0) * 100;
|
||||
if ((pos2 = index(value, '.')) != NULL) {
|
||||
if ((pos2 = strchr(value, '.')) != NULL) {
|
||||
if (isdigit(*(pos2-1)) && isdigit(*(pos2-2))) {
|
||||
if (val < 0)
|
||||
val -= strtol(pos2 + 1, NULL, 0);
|
||||
|
@ -1253,7 +1253,7 @@ static char *new_root_dir(const char *filename)
|
|||
|
||||
res = strdup(filename);
|
||||
if (res) {
|
||||
tmp = rindex(res, '/');
|
||||
tmp = strrchr(res, '/');
|
||||
if (tmp)
|
||||
*tmp = '\0';
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue