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:
Will Wagner 2009-01-19 14:19:10 +01:00 committed by Takashi Iwai
parent 4d9951ca4e
commit 9662a167d8

View file

@ -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';
}