]> git.alsa-project.org Git - alsa-utils.git/commitdiff
Use ANSI C functions
authorWill Wagner <will_wagner@carallon.com>
Mon, 19 Jan 2009 13:19:10 +0000 (14:19 +0100)
committerTakashi Iwai <tiwai@suse.de>
Mon, 19 Jan 2009 13:19:10 +0000 (14:19 +0100)
Replace non-ANSI C functions index() and rindex() with strchr() and
strrchr(), respectively.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
alsactl/init_parse.c

index 31ed56ed465959576b9cdb1bf1d2dbafe119359e..77146d23f4b6cc0624694fa39d496fad23082093 100644 (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';
        }