From: Will Wagner Date: Mon, 19 Jan 2009 13:19:10 +0000 (+0100) Subject: Use ANSI C functions X-Git-Tag: v1.0.20~17 X-Git-Url: https://git.alsa-project.org/?a=commitdiff_plain;h=9662a167d80b0a885ca7a54a143489cd56555411;p=alsa-utils.git Use ANSI C functions Replace non-ANSI C functions index() and rindex() with strchr() and strrchr(), respectively. Signed-off-by: Takashi Iwai --- diff --git a/alsactl/init_parse.c b/alsactl/init_parse.c index 31ed56e..77146d2 100644 --- a/alsactl/init_parse.c +++ b/alsactl/init_parse.c @@ -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'; }