diff options
author | George Hazan <george.hazan@gmail.com> | 2014-07-16 13:43:06 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2014-07-16 13:43:06 +0000 |
commit | eefe0f0d556fbf3d77602d0a99b9134505050756 (patch) | |
tree | 41eef7b1ea9fca98c8e22be29ba0eb07fffb19e1 /src/mir_core/protos.cpp | |
parent | 9d8530d69c5896d91e8e9468e769a4eafb9cc53b (diff) |
in _tcsncpy_s / _tcsncat_s / strncpy_s / strncat_s the second parameter to be omitted if the size of first one is fixed (not to contaminate sources with the excessive code)
git-svn-id: http://svn.miranda-ng.org/main/trunk@9829 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'src/mir_core/protos.cpp')
-rw-r--r-- | src/mir_core/protos.cpp | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/src/mir_core/protos.cpp b/src/mir_core/protos.cpp index ce752450b5..b8cacdd8fb 100644 --- a/src/mir_core/protos.cpp +++ b/src/mir_core/protos.cpp @@ -85,8 +85,8 @@ MIR_CORE_DLL(INT_PTR) ProtoCallService(const char *szModule, const char *szServi return false;
char str[MAXMODULELABELLENGTH * 2];
- strncpy_s(str,szModule,strlen(szModule));
- strncat_s(str,szService,strlen(szService));
+ strncpy_s(str, szModule, _TRUNCATE);
+ strncat_s(str, szService, _TRUNCATE);
return CallService(str, wParam, lParam);
}
@@ -98,8 +98,8 @@ MIR_CORE_DLL(int) ProtoServiceExists(const char *szModule, const char *szService return false;
char str[MAXMODULELABELLENGTH * 2];
- strncpy_s(str, szModule, strlen(szModule));
- strncat_s(str, szService, strlen(szService));
+ strncpy_s(str, szModule, _TRUNCATE);
+ strncat_s(str, szService, _TRUNCATE);
return ServiceExists(str);
}
@@ -123,16 +123,16 @@ MIR_CORE_DLL(void) ProtoDestructor(PROTO_INTERFACE *pThis) MIR_CORE_DLL(void) ProtoCreateService(PROTO_INTERFACE *pThis, const char* szService, ProtoServiceFunc serviceProc)
{
char str[MAXMODULELABELLENGTH * 2];
- strncpy_s(str, pThis->m_szModuleName, strlen(pThis->m_szModuleName));
- strncat_s(str, szService, strlen(szService));
+ strncpy_s(str, pThis->m_szModuleName, _TRUNCATE);
+ strncat_s(str, szService, _TRUNCATE);
::CreateServiceFunctionObj(str, (MIRANDASERVICEOBJ)*(void**)&serviceProc, pThis);
}
MIR_CORE_DLL(void) ProtoCreateServiceParam(PROTO_INTERFACE *pThis, const char* szService, ProtoServiceFuncParam serviceProc, LPARAM lParam)
{
char str[MAXMODULELABELLENGTH * 2];
- strncpy_s(str, pThis->m_szModuleName, strlen(pThis->m_szModuleName));
- strncat_s(str, szService, strlen(szService));
+ strncpy_s(str, pThis->m_szModuleName, _TRUNCATE);
+ strncat_s(str, szService, _TRUNCATE);
::CreateServiceFunctionObjParam(str, (MIRANDASERVICEOBJPARAM)*(void**)&serviceProc, pThis, lParam);
}
@@ -144,21 +144,21 @@ MIR_CORE_DLL(void) ProtoHookEvent(PROTO_INTERFACE *pThis, const char* szEvent, P MIR_CORE_DLL(HANDLE) ProtoCreateHookableEvent(PROTO_INTERFACE *pThis, const char* szName)
{
char str[MAXMODULELABELLENGTH * 2];
- strncpy_s(str, pThis->m_szModuleName, strlen(pThis->m_szModuleName));
- strncat_s(str, szName, strlen(szName));
+ strncpy_s(str, pThis->m_szModuleName, _TRUNCATE);
+ strncat_s(str, szName, _TRUNCATE);
return CreateHookableEvent(str);
}
MIR_CORE_DLL(void) ProtoForkThread(PROTO_INTERFACE *pThis, ProtoThreadFunc pFunc, void *param)
{
UINT threadID;
- CloseHandle((HANDLE)::mir_forkthreadowner((pThreadFuncOwner) *(void**)&pFunc, pThis, param, &threadID));
+ CloseHandle((HANDLE)::mir_forkthreadowner((pThreadFuncOwner)*(void**)&pFunc, pThis, param, &threadID));
}
MIR_CORE_DLL(HANDLE) ProtoForkThreadEx(PROTO_INTERFACE *pThis, ProtoThreadFunc pFunc, void *param, UINT* threadID)
{
UINT lthreadID;
- return (HANDLE)::mir_forkthreadowner((pThreadFuncOwner) *(void**)&pFunc, pThis, param, threadID ? threadID : <hreadID);
+ return (HANDLE)::mir_forkthreadowner((pThreadFuncOwner)*(void**)&pFunc, pThis, param, threadID ? threadID : <hreadID);
}
/////////////////////////////////////////////////////////////////////////////////////////
|