diff options
Diffstat (limited to 'plugins/AssocMgr/src/reg.cpp')
-rw-r--r-- | plugins/AssocMgr/src/reg.cpp | 13 |
1 files changed, 6 insertions, 7 deletions
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;
|