summaryrefslogtreecommitdiff
path: root/Plugins/utils/mir_buffer.h
diff options
context:
space:
mode:
authorpescuma <pescuma@c086bb3d-8645-0410-b8da-73a8550f86e7>2008-11-19 00:05:43 +0000
committerpescuma <pescuma@c086bb3d-8645-0410-b8da-73a8550f86e7>2008-11-19 00:05:43 +0000
commitaa36bdbe3da4e710417b19113b9f472b2a9cf99d (patch)
treef6c192701ba19695c150f2201cc89f000c39bcbb /Plugins/utils/mir_buffer.h
parent5fc850cb1b9c4f0826fb21fbc39d82f3a332ce67 (diff)
Fix for Buffer crash and CHECK_VERSION
git-svn-id: http://pescuma.googlecode.com/svn/trunk/Miranda@118 c086bb3d-8645-0410-b8da-73a8550f86e7
Diffstat (limited to 'Plugins/utils/mir_buffer.h')
-rw-r--r--Plugins/utils/mir_buffer.h11
1 files changed, 5 insertions, 6 deletions
diff --git a/Plugins/utils/mir_buffer.h b/Plugins/utils/mir_buffer.h
index 1bcdab3..4a5f012 100644
--- a/Plugins/utils/mir_buffer.h
+++ b/Plugins/utils/mir_buffer.h
@@ -157,9 +157,9 @@ class Buffer
{
size = total + 256 - total % 256;
if (str == NULL)
- str = (T *) malloc(size * sizeof(T));
+ str = (T *) mir_alloc(size * sizeof(T));
else
- str = (T *) realloc(str, size * sizeof(T));
+ str = (T *) mir_realloc(str, size * sizeof(T));
}
}
@@ -167,7 +167,7 @@ class Buffer
{
if (str != NULL)
{
- ::free(str);
+ mir_free(str);
str = NULL;
len = size = 0;
}
@@ -181,7 +181,7 @@ class Buffer
void append(T app)
{
- alloc(len + 1);
+ alloc(len + 1 + 1);
str[len] = app;
len++;
@@ -190,7 +190,7 @@ class Buffer
void appendn(size_t n, T app)
{
- alloc(len + n);
+ alloc(len + n + 1);
for(; n > 0; n--)
{
@@ -346,7 +346,6 @@ class Buffer
str[i] = str[len-i-1];
str[len-i-1] = tmp;
}
- pack();
}
T *appender(size_t appLen)