diff options
author | CoprDistGit <infra@openeuler.org> | 2024-08-05 02:45:17 +0000 |
---|---|---|
committer | CoprDistGit <infra@openeuler.org> | 2024-08-05 02:45:17 +0000 |
commit | 92ff4cdf8c84e91584dd6076aa5b3c774ab0a622 (patch) | |
tree | 6ba01d84d85f00b380477077d920c341c3570b09 /hplip-strstr-const.patch | |
parent | d8ce4006ffe8011c16c265205aa330c52a0de0c1 (diff) |
automatic import of hplipopeneuler24.03_LTS
Diffstat (limited to 'hplip-strstr-const.patch')
-rw-r--r-- | hplip-strstr-const.patch | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/hplip-strstr-const.patch b/hplip-strstr-const.patch new file mode 100644 index 0000000..f2ac91b --- /dev/null +++ b/hplip-strstr-const.patch @@ -0,0 +1,50 @@ +diff -up hplip-3.9.6b/prnt/hpijs/dj3320.cpp.strstr-const hplip-3.9.6b/prnt/hpijs/dj3320.cpp +--- hplip-3.9.6b/prnt/hpijs/dj3320.cpp.strstr-const 2009-06-25 21:02:29.000000000 +0100 ++++ hplip-3.9.6b/prnt/hpijs/dj3320.cpp 2009-07-27 16:14:52.868542337 +0100 +@@ -405,7 +405,7 @@ DISPLAY_STATUS DJ3320::ParseError (BYTE + { + DRIVER_ERROR err = NO_ERROR; + BYTE byDevIDBuffer[DevIDBuffSize]; +- char *pcStr = NULL; ++ const char *pcStr = NULL; + BYTE byStatus1, byStatus2; + + memset(byDevIDBuffer, 0, sizeof(byDevIDBuffer)); +diff -up hplip-3.9.6b/prnt/hpijs/registry.cpp.strstr-const hplip-3.9.6b/prnt/hpijs/registry.cpp +--- hplip-3.9.6b/prnt/hpijs/registry.cpp.strstr-const 2009-06-25 21:02:29.000000000 +0100 ++++ hplip-3.9.6b/prnt/hpijs/registry.cpp 2009-07-27 16:18:41.583417187 +0100 +@@ -290,14 +290,14 @@ DRIVER_ERROR DeviceRegistry::SelectDevic + err = pSS->GetDeviceID(DevIDBuffer, DevIDBuffSize, FALSE); + ERRCHECK; // should be either NO_ERROR or BAD_DEVICE_ID + +- char *cmdStr = (char *) strstr ((const char *) DevIDBuffer+2, "CMD:"); ++ char *cmdStr = strstr ((char *) DevIDBuffer+2, "CMD:"); + char *cmdStrEnd; + if ((strstr((const char *) DevIDBuffer+2,"CMD:LDL"))) + { + device = eDJ3320; + match = TRUE; + } +- if (!match && cmdStr && (cmdStrEnd = (char *) strstr (cmdStr, ";"))) ++ if (!match && cmdStr && (cmdStrEnd = strstr (cmdStr, ";"))) + { + *cmdStrEnd = '\0'; + if (strstr (cmdStr, "LDL")) +@@ -309,12 +309,12 @@ DRIVER_ERROR DeviceRegistry::SelectDevic + } + if (!match && !cmdStr) + { +- cmdStr = (char *) strstr ((const char *) DevIDBuffer+2, "COMMAND SET:"); ++ cmdStr = strstr ((char *) DevIDBuffer+2, "COMMAND SET:"); + } +- if (!match && cmdStr && (strstr ((const char *) cmdStr+4, "POSTSCRIPT") || +- strstr ((const char *) cmdStr+4, "PostScript") || +- strstr ((const char *) cmdStr+4, "Postscript") || +- strstr ((const char *) cmdStr+4, "postscript") )) ++ if (!match && cmdStr && (strstr (cmdStr+4, "POSTSCRIPT") || ++ strstr (cmdStr+4, "PostScript") || ++ strstr (cmdStr+4, "Postscript") || ++ strstr (cmdStr+4, "postscript") )) + { + device = ePScript; + match = TRUE; |