summaryrefslogtreecommitdiff
path: root/plugins/ConnectionNotify/src/debug.cpp
diff options
context:
space:
mode:
authorMikalaiR <nikolay.romanovich@narod.ru>2016-03-12 17:12:45 +0000
committerMikalaiR <nikolay.romanovich@narod.ru>2016-03-12 17:12:45 +0000
commit461f53bf697335fabdc82c6c9143e6020de4f022 (patch)
treeffc53fa5ea1fae2f5528dc504b02bdf7703fefa9 /plugins/ConnectionNotify/src/debug.cpp
parentf1e8c0d9758cb94a8ee0afacbe70c6fb61f04608 (diff)
ConnectionNotify: crutch removed
git-svn-id: http://svn.miranda-ng.org/main/trunk@16470 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/ConnectionNotify/src/debug.cpp')
-rw-r--r--plugins/ConnectionNotify/src/debug.cpp63
1 files changed, 6 insertions, 57 deletions
diff --git a/plugins/ConnectionNotify/src/debug.cpp b/plugins/ConnectionNotify/src/debug.cpp
index 3b49eebe41..62aa9d9dae 100644
--- a/plugins/ConnectionNotify/src/debug.cpp
+++ b/plugins/ConnectionNotify/src/debug.cpp
@@ -2,63 +2,12 @@
void _OutputDebugString(TCHAR* lpOutputString, ...)
{
- TCHAR OutMsg[MAX_LENGTH];
- TCHAR format[MAX_LENGTH];
- int i, j;
- va_list argptr;
+ CMString format;
+ va_list args;
+ va_start(args, lpOutputString);
+ format.FormatV(lpOutputString, args);
+ va_end(args);
- va_start(argptr, lpOutputString);
-
-
-
- for (i = 0, j = 0; lpOutputString[i] != '\0'; i++)
- {
- format[j++] = lpOutputString[i];
- format[j] = '\0';
-
- if (lpOutputString[i] != '%')
- continue;
-
- format[j++] = lpOutputString[++i];
- format[j] = '\0';
- switch (lpOutputString[i])
- {
- // string
- case 's':
- {
- TCHAR* s = va_arg(argptr, TCHAR *);
- mir_sntprintf(OutMsg, format, s);
- _tcsncpy(format, OutMsg, _countof(OutMsg));
- j = (int)mir_tstrlen(format);
- mir_tstrcat(format, _T(" "));
- break;
- }
- // character
- case 'c':
- {
- char c = (char)va_arg(argptr, int);
- mir_sntprintf(OutMsg, format, c);
- _tcsncpy(format, OutMsg, _countof(OutMsg));
- j = (int)mir_tstrlen(format);
- mir_tstrcat(format, _T(" "));
- break;
- }
- // integer
- case 'd':
- {
- int d = va_arg(argptr, int);
- mir_sntprintf(OutMsg, format, d);
- _tcsncpy(format, OutMsg, _countof(OutMsg));
- j = (int)mir_tstrlen(format);
- mir_tstrcat(format, _T(" "));
- break;
- }
- }
- format[j + 1] = '\0';
- }
- mir_tstrcat(format, _T("\n"));
+ format.AppendChar('\n');
OutputDebugString(format);
-
- va_end(argptr);
-
}