summaryrefslogtreecommitdiff
path: root/plugins/TipperYM/src/translations.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/TipperYM/src/translations.cpp')
-rw-r--r--plugins/TipperYM/src/translations.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/plugins/TipperYM/src/translations.cpp b/plugins/TipperYM/src/translations.cpp
index a6d13cc0d1..85a0473c92 100644
--- a/plugins/TipperYM/src/translations.cpp
+++ b/plugins/TipperYM/src/translations.cpp
@@ -28,14 +28,16 @@ HANDLE hServiceAdd;
void AddTranslation(DBVTranslation *newTrans)
{
+ DBVTranslation *ptranslations = (DBVTranslation *)mir_realloc(translations, sizeof(DBVTranslation) * (iTransFuncsCount+1));
+ if (ptranslations == NULL)
+ return;
+ translations = ptranslations;
iTransFuncsCount++;
-
- translations = (DBVTranslation *)mir_realloc(translations, sizeof(DBVTranslation) * iTransFuncsCount);
translations[iTransFuncsCount - 1] = *newTrans;
char *szName = mir_t2a(newTrans->swzName);
- char szSetting[256] = "Trans_";
- strcat(szSetting, szName);
+ char szSetting[256];
+ mir_snprintf(szSetting, sizeof(szSetting),"Trans_%s",szName);
if (_tcscmp(newTrans->swzName, _T("[No translation]")) == 0)
{