patch-src_serdisp_connect_usb_c 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. $Id: update-patches 24 2008-08-31 14:56:13Z wbx $
  2. --- serdisplib-1.97.8.orig/src/serdisp_connect_usb.c 2008-07-30 23:44:23.000000000 +0200
  3. +++ serdisplib-1.97.8/src/serdisp_connect_usb.c 2009-05-31 16:28:11.000000000 +0200
  4. @@ -220,7 +220,7 @@ serdisp_CONN_t* SDCONNusb_open(const cha
  5. #endif
  6. devname = (char*)sdcdev;
  7. - idx = index(devname, ':');
  8. + idx = strchr(devname, ':');
  9. if (serdisp_ptrdistance(idx, devname) >= 18) {
  10. sd_error(SERDISP_ENXIO, "%s(): invalid protocol (too long)", __func__);
  11. @@ -230,7 +230,7 @@ serdisp_CONN_t* SDCONNusb_open(const cha
  12. sdtools_strncpy(protocol, devname, serdisp_ptrdistance(idx, devname));
  13. devname = (idx+1);
  14. - idx = index(devname, ':');
  15. + idx = strchr(devname, ':');
  16. if (idx) {
  17. if (serdisp_ptrdistance(idx, devname) >= 8) {
  18. @@ -242,7 +242,7 @@ serdisp_CONN_t* SDCONNusb_open(const cha
  19. occurrence = (int)strtol(buffer, 0, 10);
  20. }
  21. - idx = index(devname, '/');
  22. + idx = strchr(devname, '/');
  23. if (idx && serdisp_ptrdistance(idx, devname) < 7) {
  24. sdtools_strncpy(buffer, devname, serdisp_ptrdistance(idx, devname));
  25. vendorID = (int)strtol(buffer, &endptr, 16);
  26. @@ -254,7 +254,7 @@ serdisp_CONN_t* SDCONNusb_open(const cha
  27. if (vendorID != -1) {
  28. - idx = index(devname, '/');
  29. + idx = strchr(devname, '/');
  30. if (!idx) idx = devname + strlen(devname);
  31. if (serdisp_ptrdistance(idx, devname) < 7) {
  32. sdtools_strncpy(buffer, devname, serdisp_ptrdistance(idx, devname));