hplip-strstr-const.patch 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. diff -up hplip-3.9.6b/prnt/hpijs/dj3320.cpp.strstr-const hplip-3.9.6b/prnt/hpijs/dj3320.cpp
  2. --- hplip-3.9.6b/prnt/hpijs/dj3320.cpp.strstr-const 2009-06-25 21:02:29.000000000 +0100
  3. +++ hplip-3.9.6b/prnt/hpijs/dj3320.cpp 2009-07-27 16:14:52.868542337 +0100
  4. @@ -405,7 +405,7 @@ DISPLAY_STATUS DJ3320::ParseError (BYTE
  5. {
  6. DRIVER_ERROR err = NO_ERROR;
  7. BYTE byDevIDBuffer[DevIDBuffSize];
  8. - char *pcStr = NULL;
  9. + const char *pcStr = NULL;
  10. BYTE byStatus1, byStatus2;
  11. memset(byDevIDBuffer, 0, sizeof(byDevIDBuffer));
  12. diff -up hplip-3.9.6b/prnt/hpijs/registry.cpp.strstr-const hplip-3.9.6b/prnt/hpijs/registry.cpp
  13. --- hplip-3.9.6b/prnt/hpijs/registry.cpp.strstr-const 2009-06-25 21:02:29.000000000 +0100
  14. +++ hplip-3.9.6b/prnt/hpijs/registry.cpp 2009-07-27 16:18:41.583417187 +0100
  15. @@ -290,14 +290,14 @@ DRIVER_ERROR DeviceRegistry::SelectDevic
  16. err = pSS->GetDeviceID(DevIDBuffer, DevIDBuffSize, FALSE);
  17. ERRCHECK; // should be either NO_ERROR or BAD_DEVICE_ID
  18. - char *cmdStr = (char *) strstr ((const char *) DevIDBuffer+2, "CMD:");
  19. + char *cmdStr = strstr ((char *) DevIDBuffer+2, "CMD:");
  20. char *cmdStrEnd;
  21. if ((strstr((const char *) DevIDBuffer+2,"CMD:LDL")))
  22. {
  23. device = eDJ3320;
  24. match = TRUE;
  25. }
  26. - if (!match && cmdStr && (cmdStrEnd = (char *) strstr (cmdStr, ";")))
  27. + if (!match && cmdStr && (cmdStrEnd = strstr (cmdStr, ";")))
  28. {
  29. *cmdStrEnd = '\0';
  30. if (strstr (cmdStr, "LDL"))
  31. @@ -309,12 +309,12 @@ DRIVER_ERROR DeviceRegistry::SelectDevic
  32. }
  33. if (!match && !cmdStr)
  34. {
  35. - cmdStr = (char *) strstr ((const char *) DevIDBuffer+2, "COMMAND SET:");
  36. + cmdStr = strstr ((char *) DevIDBuffer+2, "COMMAND SET:");
  37. }
  38. - if (!match && cmdStr && (strstr ((const char *) cmdStr+4, "POSTSCRIPT") ||
  39. - strstr ((const char *) cmdStr+4, "PostScript") ||
  40. - strstr ((const char *) cmdStr+4, "Postscript") ||
  41. - strstr ((const char *) cmdStr+4, "postscript") ))
  42. + if (!match && cmdStr && (strstr (cmdStr+4, "POSTSCRIPT") ||
  43. + strstr (cmdStr+4, "PostScript") ||
  44. + strstr (cmdStr+4, "Postscript") ||
  45. + strstr (cmdStr+4, "postscript") ))
  46. {
  47. device = ePScript;
  48. match = TRUE;