From 7dad3543a2b848f6547b291f812c9643dc0b85f2 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sat, 30 Jun 2012 16:17:46 +0000 Subject: Variables moved to mir_* memory allocation routines git-svn-id: http://svn.miranda-ng.org/main/trunk@696 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/Variables/parse_alias.cpp | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) (limited to 'plugins/Variables/parse_alias.cpp') diff --git a/plugins/Variables/parse_alias.cpp b/plugins/Variables/parse_alias.cpp index 2fe4164d15..9c44a2f915 100644 --- a/plugins/Variables/parse_alias.cpp +++ b/plugins/Variables/parse_alias.cpp @@ -2,7 +2,7 @@ Variables Plugin for Miranda-IM (www.miranda-im.org) Copyright 2003-2006 P. Boon - This program is free software; you can redistribute it and/or modify + This program is mir_free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. @@ -86,7 +86,7 @@ static TCHAR *parseTranslateAlias(ARGUMENTSINFO *ai) { if ( (areg == NULL) || (areg->argc != ai->argc-1)) { return NULL; } - res = _tcsdup(areg->szTranslation); + res = mir_tstrdup(areg->szTranslation); for (i=0;iargc;i++) { res = replaceArguments(res, areg->argv[i], ai->targv[i+1]); if (res == NULL) { @@ -107,11 +107,11 @@ static int addToAliasRegister(TCHAR *szAlias, unsigned int argc, TCHAR** argv, T EnterCriticalSection(&csAliasRegister); for (i=0;itargv[1])+1), sizeof(TCHAR)); + alias = ( TCHAR* )mir_calloc(((cur-ai->targv[1])+1)*sizeof(TCHAR)); if (alias == NULL) return NULL; @@ -180,7 +180,7 @@ static TCHAR *parseAddAlias(ARGUMENTSINFO *ai) { szArgs = NULL; for (i=0;i 0)) { - szArgsA = u2a(szArgs); + szArgsA = mir_t2a(szArgs); - szHelp = ( char* )malloc(32 + strlen(szArgsA)); + szHelp = ( char* )mir_alloc(32 + strlen(szArgsA)); memset(szHelp, '\0', 32 + strlen(szArgsA)); sprintf(szHelp, "Alias\t(%s)\tuser defined", szArgsA); res = registerIntToken(alias, parseTranslateAlias, TRF_FUNCTION|TRF_UNPARSEDARGS, szHelp); - free(szArgsA); + mir_free(szArgsA); } else { - szHelp = ( char* )malloc(32); + szHelp = ( char* )mir_alloc(32); memset(szHelp, '\0', 32); sprintf(szHelp, "Alias\t\tuser defined"); res = registerIntToken(alias, parseTranslateAlias, TRF_FIELD|TRF_UNPARSEDARGS, szHelp); } - free(szArgs); - free(szHelp); + mir_free(szArgs); + mir_free(szHelp); - return res==0?_tcsdup(_T("")):NULL; + return res==0?mir_tstrdup(_T("")):NULL; } int registerAliasTokens() -- cgit v1.2.3