diff options
author | Alexander Gluzsky <sss123next@list.ru> | 2012-08-09 05:27:38 +0000 |
---|---|---|
committer | Alexander Gluzsky <sss123next@list.ru> | 2012-08-09 05:27:38 +0000 |
commit | 4c2a5360e8634c27f820780aef365421cefec7ed (patch) | |
tree | 7b3a608911b763e4ea6f994a4a2e03e8c832d841 /plugins/New_GPG/src/utilities.cpp | |
parent | 71f9ef9ded15566ee811508a6c9b8eee21facfa8 (diff) |
used dynamic buffer for gpg data (fixes problem with large gpg output)
git-svn-id: http://svn.miranda-ng.org/main/trunk@1411 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/New_GPG/src/utilities.cpp')
-rwxr-xr-x | plugins/New_GPG/src/utilities.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/plugins/New_GPG/src/utilities.cpp b/plugins/New_GPG/src/utilities.cpp index 6b84c07954..1e9d8997b8 100755 --- a/plugins/New_GPG/src/utilities.cpp +++ b/plugins/New_GPG/src/utilities.cpp @@ -563,16 +563,18 @@ int onSendFile(WPARAM w, LPARAM l) void storeOutput(HANDLE ahandle, string *output) { BOOL success; - char readbuffer[4096] = {0}; + char *readbuffer = NULL; unsigned long transfered, available; do { PeekNamedPipe(ahandle,NULL,0,NULL,&available,NULL); if (!available) continue; - success=ReadFile(ahandle,readbuffer,sizeof(readbuffer),&transfered,NULL); + readbuffer = (char*)mir_alloc(available); + success=ReadFile(ahandle,readbuffer,available,&transfered,NULL); if (success && transfered) - output->append(readbuffer, 4096); + output->append(readbuffer, available); + mir_free(readbuffer); } while (available>0); } |