From b2fad485cd5b41744ef0cc4a02722c021afd926c Mon Sep 17 00:00:00 2001 From: Rozhuk Ivan Date: Mon, 1 Dec 2014 00:07:01 +0000 Subject: ZeroMemory -> memset, few bugs fised git-svn-id: http://svn.miranda-ng.org/main/trunk@11184 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/CryptoPP/src/GPGw/gpg_main.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'plugins/CryptoPP/src/GPGw/gpg_main.cpp') diff --git a/plugins/CryptoPP/src/GPGw/gpg_main.cpp b/plugins/CryptoPP/src/GPGw/gpg_main.cpp index 61c076e8df..ffb6a65e02 100644 --- a/plugins/CryptoPP/src/GPGw/gpg_main.cpp +++ b/plugins/CryptoPP/src/GPGw/gpg_main.cpp @@ -168,7 +168,7 @@ LPSTR __cdecl _gpg_encrypt(LPCSTR message, LPCSTR keyid) if(strlen(keyid)) { - ZeroMemory(buffer, sizeof(buffer)); + memset(buffer, 0, sizeof(buffer)); gpgresult=gpgEncrypt(buffer, keyid, message); if(gpgresult!=gpgSuccess) @@ -205,7 +205,7 @@ LPSTR __cdecl _gpg_decrypt(LPCSTR message) replace(buffer, "\r", ""); replace(buffer, "\n", txtcrlf); - ZeroMemory(keyuserid, sizeof(keyuserid)); + memset(keyuserid, 0, sizeof(keyuserid)); gpgresult=gpgDetectUserID(keyuserid, buffer); storedpassphrase=NULL; @@ -224,7 +224,7 @@ LPSTR __cdecl _gpg_decrypt(LPCSTR message) if(storedpassphrase!=NULL) { strcpy(passphrase, storedpassphrase); - ZeroMemory(plaintext, sizeof(plaintext)); + memset(plaintext, 0, sizeof(plaintext)); gpgresult=gpgDecrypt(plaintext, buffer, passphrase); } else gpgresult=gpgUnknownError; @@ -237,9 +237,9 @@ LPSTR __cdecl _gpg_decrypt(LPCSTR message) if(dlgresult==IDOK) { strcpy(passphrase, dlgpassphrase); - ZeroMemory(dlgpassphrase, passphrasesize); + memset(dlgpassphrase, 0, passphrasesize); strcat(passphrase, txtcrlf); - ZeroMemory(plaintext, sizeof(plaintext)); + memset(plaintext, 0, sizeof(plaintext)); gpgresult=gpgDecrypt(plaintext, buffer, passphrase); } } @@ -252,7 +252,7 @@ LPSTR __cdecl _gpg_decrypt(LPCSTR message) if ( gpgresult==gpgSuccess && useridvalid==TRUE) addPassphrase(keyuserid, passphrase); - ZeroMemory(passphrase, sizeof(passphrase)); + memset(passphrase, 0, sizeof(passphrase)); decmessagelen = strlen(buffer)+1; decmessage = (char *) LocalAlloc(LPTR,decmessagelen); @@ -273,11 +273,11 @@ int __cdecl _gpg_select_keyid(HWND hdlg, LPSTR keyid) { int dlgresult; - ZeroMemory(keyid, keyidsize); + memset(keyid, 0, keyidsize); dlgresult=DialogBoxParam(g_hInst, MAKEINTRESOURCE(IDD_SELECTKEY), hdlg, UserIdDialogProcedure, (LPARAM)keyid); if(dlgresult!=IDOK) - ZeroMemory(keyid, keyidsize); + memset(keyid, 0, keyidsize); return (dlgresult==IDOK); } @@ -325,7 +325,7 @@ LPSTR GetEnvValue(LPCSTR szName) BOOL ShowSelectExecDlg(LPSTR path) { OPENFILENAME ofn; - ZeroMemory(&ofn,sizeof(ofn)); + memset(&ofn, 0, sizeof(ofn)); ofn.lpstrFile = GetRegValue(HKEY_CURRENT_USER,"Software\\GNU\\GnuPG","gpgProgram"); if ( ofn.lpstrFile && existsFile(ofn.lpstrFile) ) { -- cgit v1.2.3