summaryrefslogtreecommitdiff
path: root/plugins/TipperYM/src/skin_parser.cpp
diff options
context:
space:
mode:
authorTobias Weimer <wishmaster51@googlemail.com>2015-02-28 11:05:09 +0000
committerTobias Weimer <wishmaster51@googlemail.com>2015-02-28 11:05:09 +0000
commitb1530a48bd67d19f6a18355e04a884b36c696e8b (patch)
tree539cc8c4387b586658898a146b8876cc133f8783 /plugins/TipperYM/src/skin_parser.cpp
parent4e2a8eb11a9a4286eb0bcb3386bab58e87ae4b69 (diff)
Tipper:
- minor bugfixes git-svn-id: http://svn.miranda-ng.org/main/trunk@12284 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/TipperYM/src/skin_parser.cpp')
-rw-r--r--plugins/TipperYM/src/skin_parser.cpp23
1 files changed, 11 insertions, 12 deletions
diff --git a/plugins/TipperYM/src/skin_parser.cpp b/plugins/TipperYM/src/skin_parser.cpp
index d5db13e01d..f93448d397 100644
--- a/plugins/TipperYM/src/skin_parser.cpp
+++ b/plugins/TipperYM/src/skin_parser.cpp
@@ -167,23 +167,22 @@ void ParseImagePart(FILE *fp, TCHAR *buff, int iPart)
}
}
-char *GetSettingName(TCHAR *szValue, char *szPostfix, char *buff)
+char *GetSettingName(TCHAR *szValue, char *szPostfix, char *buff, size_t buffsize)
{
buff[0] = 0;
if (_tcsstr(szValue, _T("traytitle")))
- mir_snprintf(buff, SIZEOF(buff), "FontTrayTitle%s", szPostfix);
+ mir_snprintf(buff, buffsize, "FontTrayTitle%s", szPostfix);
else if (_tcsstr(szValue, _T("title")))
- mir_snprintf(buff, SIZEOF(buff), "FontFirst%s", szPostfix);
+ mir_snprintf(buff, buffsize, "FontFirst%s", szPostfix);
else if (_tcsstr(szValue, _T("label")))
- mir_snprintf(buff, SIZEOF(buff), "FontLabels%s", szPostfix);
+ mir_snprintf(buff, buffsize, "FontLabels%s", szPostfix);
else if (_tcsstr(szValue, _T("value")))
- mir_snprintf(buff, SIZEOF(buff), "FontValues%s", szPostfix);
+ mir_snprintf(buff, buffsize, "FontValues%s", szPostfix);
else if (_tcsstr(szValue, _T("divider")))
- mir_snprintf(buff, SIZEOF(buff), "Divider%s", szPostfix);
+ mir_snprintf(buff, buffsize, "Divider%s", szPostfix);
- if (buff[0]) return buff;
- else return NULL;
+ return buff[0] ? buff : NULL;
}
void ParseFontPart(FILE *fp, TCHAR *buff)
@@ -205,7 +204,7 @@ void ParseFontPart(FILE *fp, TCHAR *buff)
{
if (_tcsstr(buff, _T("face")))
{
- if (GetSettingName(buff, "", szSetting))
+ if (GetSettingName(buff, "", szSetting, sizeof(szSetting) - 1))
{
if (_tcslen(pch) > 32)
pch[32] = 0;
@@ -215,7 +214,7 @@ void ParseFontPart(FILE *fp, TCHAR *buff)
}
else if (_tcsstr(buff, _T("color")))
{
- if (GetSettingName(buff, "Col", szSetting))
+ if (GetSettingName(buff, "Col", szSetting, sizeof(szSetting) - 1))
{
BYTE r = _ttoi(pch);
pch = _tcschr(pch, ' ');
@@ -234,7 +233,7 @@ void ParseFontPart(FILE *fp, TCHAR *buff)
}
else if (_tcsstr(buff, _T("size")))
{
- if (GetSettingName(buff, "Size", szSetting))
+ if (GetSettingName(buff, "Size", szSetting, sizeof(szSetting) - 1))
{
HDC hdc = GetDC(0);
int size = -MulDiv(_ttoi(pch), GetDeviceCaps(hdc, LOGPIXELSY), 72);
@@ -244,7 +243,7 @@ void ParseFontPart(FILE *fp, TCHAR *buff)
}
else if (_tcsstr(buff, _T("effect")))
{
- if (GetSettingName(buff, "Sty", szSetting))
+ if (GetSettingName(buff, "Sty", szSetting, sizeof(szSetting) - 1))
{
BYTE effect = 0;
if (_tcsstr(pch, _T("font_bold")))