diff options
author | George Hazan <george.hazan@gmail.com> | 2014-12-02 20:19:18 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2014-12-02 20:19:18 +0000 |
commit | aeae01dc50a5adea8fe003c8195540b1f2b2169f (patch) | |
tree | 2c8f055fc562f9365e00577147fefb1a609b51c8 /plugins/Scriver/src/utils.cpp | |
parent | 7cc46e2ce850957887aa75146585bca56b10695d (diff) |
more transparent implementation of AppendToBuffer
git-svn-id: http://svn.miranda-ng.org/main/trunk@11222 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Scriver/src/utils.cpp')
-rw-r--r-- | plugins/Scriver/src/utils.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/plugins/Scriver/src/utils.cpp b/plugins/Scriver/src/utils.cpp index c3b663bd3f..1f6b99e682 100644 --- a/plugins/Scriver/src/utils.cpp +++ b/plugins/Scriver/src/utils.cpp @@ -269,21 +269,21 @@ TCHAR *GetRichEditSelection(HWND hwnd) return NULL;
}
-void AppendToBuffer(char **buffer, int *cbBufferEnd, int *cbBufferAlloced, const char *fmt, ...)
+void AppendToBuffer(char *&buffer, size_t &cbBufferEnd, size_t &cbBufferAlloced, const char *fmt, ...)
{
va_list va;
int charsDone;
va_start(va, fmt);
for (;;) {
- charsDone = mir_vsnprintf(*buffer + *cbBufferEnd, *cbBufferAlloced - *cbBufferEnd, fmt, va);
+ charsDone = mir_vsnprintf(buffer + cbBufferEnd, cbBufferAlloced - cbBufferEnd, fmt, va);
if (charsDone >= 0)
break;
- *cbBufferAlloced += 1024;
- *buffer = (char*)mir_realloc(*buffer, *cbBufferAlloced);
+ cbBufferAlloced += 1024;
+ buffer = (char*)mir_realloc(buffer, cbBufferAlloced);
}
va_end(va);
- *cbBufferEnd += charsDone;
+ cbBufferEnd += charsDone;
}
|