Ticket #7201: patch-prnt_hpijs_ljzjscolor.cpp

File patch-prnt_hpijs_ljzjscolor.cpp, 793 bytes (added by okmacports@…, 13 years ago)
Line 
1--- prnt/hpijs/ljzjscolor.cpp.orig      2010-12-19 21:34:26.000000000 +0100
2+++ prnt/hpijs/ljzjscolor.cpp   2010-12-19 21:33:52.000000000 +0100
3@@ -40,6 +40,16 @@
4 
5 APDK_BEGIN_NAMESPACE
6 
7+int LJ_strnlen (const char *s, int size)
8+{ 
9+  int i;
10+ 
11+  for (i = 0; i < size; i++)
12+    if (s[i] == 0)
13+      return i;
14+  return size;
15+}
16+
17 extern uint32_t ulMapGRAY_K_6x6x1[9 * 9 * 9];
18 
19 extern uint32_t ulMapDJ600_CCM_K[9 * 9 * 9];
20@@ -88,7 +98,7 @@
21        m_bSIDModel = FALSE;
22        err = pSS->GetDeviceID(strDeviceID,DevIDBuffSize,FALSE);
23        if( NO_ERROR == err &&
24-               (strnlen((const char*)strDeviceID, DevIDBuffSize)< DevIDBuffSize) && 
25+               (LJ_strnlen((const char*)strDeviceID, DevIDBuffSize)< DevIDBuffSize) && 
26                (strstr((const char*)strDeviceID, (const char*)szSIDModelName)))
27        {
28                m_bSIDModel = TRUE;