diff options
author | George Hazan <george.hazan@gmail.com> | 2013-04-06 21:07:53 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2013-04-06 21:07:53 +0000 |
commit | 37f0dfdfac4dc0af578769b02e29efb9926415bb (patch) | |
tree | cadf855bb7a074eb78f45b725e5b9a3e965fa045 /plugins/IEView/src/Utils.cpp | |
parent | e7891a7f13d94b6eae7f74f7354e0a3643d1de01 (diff) |
postfix to the standard functions patch by Mataes
git-svn-id: http://svn.miranda-ng.org/main/trunk@4351 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/IEView/src/Utils.cpp')
-rw-r--r-- | plugins/IEView/src/Utils.cpp | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/plugins/IEView/src/Utils.cpp b/plugins/IEView/src/Utils.cpp index 888a526101..85a4f07be6 100644 --- a/plugins/IEView/src/Utils.cpp +++ b/plugins/IEView/src/Utils.cpp @@ -34,7 +34,7 @@ wchar_t* Utils::toAbsolute(wchar_t* relative) const wchar_t* bdir = getBaseDir();
long len = (int)wcslen(bdir);
long tlen = len + (int)wcslen(relative);
- wchar_t* result = new wchar_t[tlen + 1];
+ wchar_t* result = (wchar_t*)mir_alloc(sizeof(wchar_t)*(tlen + 1));
if(result) {
wcscpy(result, bdir);
wcscpy(result + len, relative);
@@ -159,19 +159,17 @@ int Utils::detectURL(const wchar_t *text) char *Utils::escapeString(const char *a)
{
- int i, l, len;
- char *out;
- if (a == NULL) {
+ if (a == NULL)
return NULL;
- }
- len = (int)strlen(a);
+
+ int i, l, len = (int)strlen(a);
for (i = l = 0; i < len; i++, l++) {
if (a[i] == '\\' || a[i] == '\n' || a[i] == '\r' || a[i] == '\"'
|| a[i] == '\'' || a[i] == '\b' || a[i] == '\t' || a[i] == '\f') {
l++;
}
}
- out = new char[l+1];
+ char *out = (char*)mir_alloc(l+1);
for (i = l = 0; i < len; i++, l++) {
if (a[i] == '\\' || a[i] == '\n' || a[i] == '\r' || a[i] == '\"'
|| a[i] == '\'' || a[i] == '\b' || a[i] == '\t' || a[i] == '\f') {
@@ -186,4 +184,4 @@ char *Utils::escapeString(const char *a) void Utils::appendIcon(char **str, int *sizeAlloced, const char *iconFile)
{
Utils::appendText(str, sizeAlloced, "<img class=\"img\" src=\"file://%s/plugins/ieview/%s\"/> ", workingDirUtf8, iconFile);
-}
\ No newline at end of file +}
|