patch-alsactl_init_parse_c 861 B

123456789101112131415161718192021
  1. $Id: update-patches 24 2008-08-31 14:56:13Z wbx $
  2. --- alsa-utils-1.0.19.orig/alsactl/init_parse.c 2009-01-19 12:17:19.000000000 +0100
  3. +++ alsa-utils-1.0.19/alsactl/init_parse.c 2009-05-09 04:56:45.000000000 +0200
  4. @@ -381,7 +381,7 @@ static int set_ctl_value(struct space *s
  5. snd_ctl_elem_value_set_integer(space->ctl_value, idx, val);
  6. } else if (items > 2 && value[items-2] == 'd' && value[items-1] == 'B') {
  7. val = strtol(value, NULL, 0) * 100;
  8. - if ((pos2 = index(value, '.')) != NULL) {
  9. + if ((pos2 = strchr(value, '.')) != NULL) {
  10. if (isdigit(*(pos2-1)) && isdigit(*(pos2-2))) {
  11. if (val < 0)
  12. val -= strtol(pos2 + 1, NULL, 0);
  13. @@ -1253,7 +1253,7 @@ static char *new_root_dir(const char *fi
  14. res = strdup(filename);
  15. if (res) {
  16. - tmp = rindex(res, '/');
  17. + tmp = strrchr(res, '/');
  18. if (tmp)
  19. *tmp = '\0';
  20. }