summaryrefslogtreecommitdiff
path: root/plugins/New_GPG/src/utilities.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/New_GPG/src/utilities.cpp')
-rwxr-xr-xplugins/New_GPG/src/utilities.cpp8
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);
}