diff options
author | Tobias Weimer <wishmaster51@googlemail.com> | 2015-02-28 11:05:09 +0000 |
---|---|---|
committer | Tobias Weimer <wishmaster51@googlemail.com> | 2015-02-28 11:05:09 +0000 |
commit | b1530a48bd67d19f6a18355e04a884b36c696e8b (patch) | |
tree | 539cc8c4387b586658898a146b8876cc133f8783 /plugins/TipperYM/src/mir_smileys.cpp | |
parent | 4e2a8eb11a9a4286eb0bcb3386bab58e87ae4b69 (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/mir_smileys.cpp')
-rw-r--r-- | plugins/TipperYM/src/mir_smileys.cpp | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/plugins/TipperYM/src/mir_smileys.cpp b/plugins/TipperYM/src/mir_smileys.cpp index 9c55d8c5c9..ca94e5310c 100644 --- a/plugins/TipperYM/src/mir_smileys.cpp +++ b/plugins/TipperYM/src/mir_smileys.cpp @@ -335,28 +335,26 @@ void DestroySmileyList(SortedList* p_list) // Generete the list of smileys / text to be drawn
SortedList *ReplaceSmileys(const TCHAR *text, int text_size, const char *protocol, int *max_smiley_height)
{
- SMADD_BATCHPARSE2 sp = {0};
- SMADD_BATCHPARSERES *spres;
- char smileyProto[64];
-
*max_smiley_height = 0;
if (!text || !text[0] || !ServiceExists(MS_SMILEYADD_BATCHPARSE))
return NULL;
+ char smileyProto[64];
if (protocol == NULL)
- strcpy(smileyProto, "tipper");
+ strncpy(smileyProto, "tipper", sizeof(smileyProto) - 1);
else if (strcmp(protocol, META_PROTO) == 0)
- strcpy(smileyProto, "tipper");
+ strncpy(smileyProto, "tipper", sizeof(smileyProto) - 1);
else
- strcpy(smileyProto, protocol);
+ strncpy(smileyProto, protocol, sizeof(smileyProto) - 1);
// Parse it!
+ SMADD_BATCHPARSE2 sp = {0};
sp.cbSize = sizeof(sp);
sp.str = (TCHAR *)text;
sp.flag = SAFL_TCHAR;
sp.Protocolname = (opt.iSmileyAddFlags & SMILEYADD_USEPROTO) ? smileyProto : "tipper";
- spres = (SMADD_BATCHPARSERES *)CallService(MS_SMILEYADD_BATCHPARSE, 0, (LPARAM)&sp);
+ SMADD_BATCHPARSERES *spres = (SMADD_BATCHPARSERES *)CallService(MS_SMILEYADD_BATCHPARSE, 0, (LPARAM)&sp);
if (!spres) // Did not find a smiley
return NULL;
|