diff options
author | George Hazan <george.hazan@gmail.com> | 2013-03-17 15:06:11 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2013-03-17 15:06:11 +0000 |
commit | 82ae452fff08430d514f762f49e78fec90f88625 (patch) | |
tree | 184c31c029a364eec13b58d060d20ba85b2a20bc /plugins/CryptoPP/src/main.cpp | |
parent | 15267ea2d489606fb4b99d011bc3ea7c2a644a9f (diff) |
- rest of memory leaks
- code cleaning;
git-svn-id: http://svn.miranda-ng.org/main/trunk@4078 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/CryptoPP/src/main.cpp')
-rw-r--r-- | plugins/CryptoPP/src/main.cpp | 44 |
1 files changed, 22 insertions, 22 deletions
diff --git a/plugins/CryptoPP/src/main.cpp b/plugins/CryptoPP/src/main.cpp index 7869c8d416..dacdfda235 100644 --- a/plugins/CryptoPP/src/main.cpp +++ b/plugins/CryptoPP/src/main.cpp @@ -89,34 +89,34 @@ extern "C" __declspec(dllexport) int Unload() BOOL ExtractFileFromResource( HANDLE FH, int ResType, int ResId, DWORD* Size )
{
- HRSRC RH;
- PBYTE RP;
- DWORD s,x;
-
- RH = FindResource( g_hInst, MAKEINTRESOURCE( ResId ), MAKEINTRESOURCE( ResType ) );
-
- if ( RH == NULL ) return FALSE;
- RP = (PBYTE) LoadResource( g_hInst, RH );
- if ( RP == NULL ) return FALSE;
- s = SizeofResource( g_hInst, RH );
- if ( !WriteFile( FH, RP, s, &x, NULL ) ) return FALSE;
- if ( x != s ) return FALSE;
- if ( Size ) *Size = s;
- return TRUE;
+ HRSRC RH = FindResource(g_hInst, MAKEINTRESOURCE(ResId), MAKEINTRESOURCE(ResType));
+ if ( RH == NULL )
+ return FALSE;
+
+ PBYTE RP = (PBYTE) LoadResource( g_hInst, RH );
+ if ( RP == NULL )
+ return FALSE;
+
+ DWORD x, s = SizeofResource(g_hInst, RH);
+ if ( !WriteFile(FH, RP, s, &x, NULL)) return FALSE;
+ if (x != s) return FALSE;
+ if (Size) *Size = s;
+ return TRUE;
}
-
-void ExtractFile( char *FileName, int ResType, int ResId )
+void ExtractFile(char *FileName, int ResType, int ResId)
{
- HANDLE FH;
- FH = CreateFile( FileName, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, 0, NULL );
- if ( FH == INVALID_HANDLE_VALUE ) return;
- if (!ExtractFileFromResource( FH, ResType, ResId, NULL )) MessageBoxA(0,"Can't extract","!!!",MB_OK);
+ HANDLE FH = CreateFile( FileName, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, 0, NULL );
+ if (FH == INVALID_HANDLE_VALUE)
+ return;
+
+ if (!ExtractFileFromResource( FH, ResType, ResId, NULL ))
+ MessageBoxA(0,"Can't extract","!!!",MB_OK);
CloseHandle( FH );
}
-
-size_t rtrim(LPCSTR str) {
+size_t rtrim(LPCSTR str)
+{
size_t len = strlen(str);
LPSTR ptr = (LPSTR)str+len-1;
|