lm-sensors.01.susv3-legacy.patch.not 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. diff -rdup lm_sensors-2.10.4.oorig/lib/proc.c lm_sensors-2.10.4/lib/proc.c
  2. --- lm_sensors-2.10.4.oorig/lib/proc.c 2007-07-17 06:53:06.000000000 +0200
  3. +++ lm_sensors-2.10.4/lib/proc.c 2007-09-20 13:30:39.000000000 +0200
  4. @@ -93,16 +93,16 @@ int sensors_read_proc_bus(void)
  5. while (fgets(line,255,f)) {
  6. if (strlen(line) > 0)
  7. line[strlen(line)-1] = '\0';
  8. - if (! (border = rindex(line,'\t')))
  9. + if (! (border = strrchr(line,'\t')))
  10. goto ERROR;
  11. /* Skip algorithm name */
  12. *border='\0';
  13. - if (! (border = rindex(line,'\t')))
  14. + if (! (border = strrchr(line,'\t')))
  15. goto ERROR;
  16. if (! (entry.adapter = strdup(border + 1)))
  17. goto FAT_ERROR;
  18. *border='\0';
  19. - if (! (border = rindex(line,'\t')))
  20. + if (! (border = strrchr(line,'\t')))
  21. goto ERROR;
  22. *border='\0';
  23. if (strncmp(line,"i2c-",4))
  24. @@ -155,8 +155,8 @@ int sensors_read_proc(sensors_chip_name
  25. strcpy(n, name.busname);
  26. strcat(n, "/");
  27. strcpy(altn, n);
  28. - /* use rindex to append sysname to n */
  29. - getsysname(the_feature, rindex(n, '\0'), &mag, rindex(altn, '\0'));
  30. + /* use strrchr to append sysname to n */
  31. + getsysname(the_feature, strrchr(n, '\0'), &mag, strrchr(altn, '\0'));
  32. if ((f = fopen(n, "r")) != NULL
  33. || (f = fopen(altn, "r")) != NULL) {
  34. int res = fscanf(f, "%lf", value);
  35. @@ -198,8 +198,8 @@ int sensors_write_proc(sensors_chip_name
  36. strcpy(n, name.busname);
  37. strcat(n, "/");
  38. strcpy(altn, n);
  39. - /* use rindex to append sysname to n */
  40. - getsysname(the_feature, rindex(n, '\0'), &mag, rindex(altn, '\0'));
  41. + /* use strrchr to append sysname to n */
  42. + getsysname(the_feature, strrchr(n, '\0'), &mag, strrchr(altn, '\0'));
  43. if ((f = fopen(n, "w")) != NULL
  44. || (f = fopen(altn, "w")) != NULL) {
  45. for (; mag > 0; mag --)
  46. diff -rdup lm_sensors-2.10.4.oorig/prog/dump/i2cbusses.c lm_sensors-2.10.4/prog/dump/i2cbusses.c
  47. --- lm_sensors-2.10.4.oorig/prog/dump/i2cbusses.c 2007-07-17 06:53:10.000000000 +0200
  48. +++ lm_sensors-2.10.4/prog/dump/i2cbusses.c 2007-09-20 13:29:19.000000000 +0200
  49. @@ -185,7 +185,7 @@ found:
  50. fprintf(stderr, "%s: read error\n", n);
  51. continue;
  52. }
  53. - if((border = index(x, '\n')) != NULL)
  54. + if((border = strchr(x, '\n')) != NULL)
  55. *border = 0;
  56. if(count++ == 0 && !procfmt)
  57. fprintf(stderr," Installed I2C busses:\n");