Ticket #30061: patch-prnt_hpijs_context2.cpp

File patch-prnt_hpijs_context2.cpp, 861 bytes (added by okmacports@…, 13 years ago)
Line 
1--- prnt/hpijs/context2.cpp.orig        2011-05-14 20:24:02.000000000 +0200
2+++ prnt/hpijs/context2.cpp     2011-07-06 18:44:26.000000000 +0200
3@@ -39,6 +39,7 @@
4 //#include "bug.h"
5 
6 APDK_BEGIN_NAMESPACE
7+
8 extern ColorMatcher* Create_ColorMatcher
9 (
10     SystemServices* pSys,
11@@ -49,6 +50,15 @@
12 APDK_END_NAMESPACE
13 
14 APDK_BEGIN_NAMESPACE
15+int APDK_strnlen (const char *s, int size)
16+{ 
17+  int i;
18+ 
19+  for (i = 0; i < size; i++)
20+    if (s[i] == 0)
21+      return i;
22+  return size;
23+}
24 
25 extern PAPER_SIZE MediaSizeToPaper(MediaSize msize);
26 extern MediaSize PaperToMediaSize(PAPER_SIZE psize);
27@@ -1299,7 +1309,7 @@
28     {
29         return UNSUPPORTED_PRINTER;
30     }
31-       if(0 == strnlen((const char *)pSS->strDevID, DevIDBuffSize))
32+       if(0 == APDK_strnlen((const char *)pSS->strDevID, DevIDBuffSize))
33        {
34                strncpy((char *)pSS->strDevID,szDeviceId,DevIDBuffSize);
35        }