diff options
author | George Hazan <george.hazan@gmail.com> | 2013-07-24 09:38:43 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2013-07-24 09:38:43 +0000 |
commit | d499d067c4e901c3d8750726405002fe033f4771 (patch) | |
tree | 887a8a9ba9cf87ac2802921b46015e2aac69be64 | |
parent | fd492249e2b276a2b88b88539988725541bcb988 (diff) |
oops... missed another mir_snprintf in AssocMgr
git-svn-id: http://svn.miranda-ng.org/main/trunk@5465 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
-rw-r--r-- | plugins/AssocMgr/src/assoclist.cpp | 18 | ||||
-rw-r--r-- | plugins/AssocMgr/src/reg.cpp | 13 |
2 files changed, 13 insertions, 18 deletions
diff --git a/plugins/AssocMgr/src/assoclist.cpp b/plugins/AssocMgr/src/assoclist.cpp index 4124b493f4..310a396522 100644 --- a/plugins/AssocMgr/src/assoclist.cpp +++ b/plugins/AssocMgr/src/assoclist.cpp @@ -486,23 +486,19 @@ static BOOL RemoveAssocItem_Worker(const char *pszClassName) /************************* Services *******************************/
-static INT_PTR ServiceAddNewFileType(WPARAM wParam, LPARAM lParam)
+static INT_PTR ServiceAddNewFileType(WPARAM, LPARAM lParam)
{
const FILETYPEDESC *ftd = (FILETYPEDESC*)lParam;
- char *pszClassName, *pszFileExt, *pszMimeType;
- TCHAR *pszVerbDesc;
- UNREFERENCED_PARAMETER(wParam);
-
- if(ftd->cbSize<sizeof(FILETYPEDESC))
+ if(ftd->cbSize < sizeof(FILETYPEDESC))
return 1;
- if(ftd->pszFileExt == NULL || ftd->pszFileExt[0]!= '.')
+ if(ftd->pszFileExt == NULL || ftd->pszFileExt[0] != '.')
return 2;
- pszFileExt = mir_strdup(ftd->pszFileExt);
- pszClassName = MakeFileClassName(ftd->pszFileExt);
+ char *pszFileExt = mir_strdup(ftd->pszFileExt);
+ char *pszClassName = MakeFileClassName(ftd->pszFileExt);
if(pszFileExt!= NULL && pszClassName!= NULL) {
- pszVerbDesc = s2t(ftd->ptszVerbDesc, ftd->flags&FTDF_UNICODE, TRUE); /* does NULL check */
- pszMimeType = mir_strdup(ftd->pszMimeType); /* does NULL check */
+ TCHAR *pszVerbDesc = s2t(ftd->ptszVerbDesc, ftd->flags&FTDF_UNICODE, TRUE); /* does NULL check */
+ char *pszMimeType = mir_strdup(ftd->pszMimeType); /* does NULL check */
if(AddNewAssocItem_Worker(pszClassName, (TYPEDESCHEAD*)ftd, pszFileExt, pszVerbDesc, pszMimeType))
/* no need to free pszClassName, pszFileExt, pszVerbDesc and pszMimeType,
* as their ownership got transfered to storage list */
diff --git a/plugins/AssocMgr/src/reg.cpp b/plugins/AssocMgr/src/reg.cpp index 5f97defa14..be921d8c3a 100644 --- a/plugins/AssocMgr/src/reg.cpp +++ b/plugins/AssocMgr/src/reg.cpp @@ -98,20 +98,19 @@ static __inline LONG regchk(LONG res, const char *pszFunc, const void *pszInfo, // mir_free() the return value
char *MakeFileClassName(const char *pszFileExt)
{
- char *pszClass;
- pszClass=(char*)mir_alloc((lstrlenA(pszFileExt)+12)*sizeof(TCHAR));
- if (pszClass!=NULL)
+ int cbLen = lstrlenA(pszFileExt)+12;
+ char *pszClass = (char*)mir_alloc(cbLen);
+ if (pszClass != NULL)
/* using correctly formated PROGID */
- mir_snprintf(pszClass, strlen(pszClass), "miranda%sfile", pszFileExt); /* includes dot, buffer safe */
+ mir_snprintf(pszClass, cbLen, "miranda%sfile", pszFileExt); /* includes dot, buffer safe */
return pszClass;
}
// mir_free() the return value
char *MakeUrlClassName(const char *pszUrl)
{
- char *pszClass;
- pszClass=mir_strdup(pszUrl);
- if (pszClass!=NULL)
+ char *pszClass = mir_strdup(pszUrl);
+ if (pszClass != NULL)
/* remove trailing : */
pszClass[lstrlenA(pszClass)-1]=0;
return pszClass;
|