diff options
author | Kirill Volinsky <mataes2007@gmail.com> | 2015-05-16 17:34:54 +0000 |
---|---|---|
committer | Kirill Volinsky <mataes2007@gmail.com> | 2015-05-16 17:34:54 +0000 |
commit | b97306f8dc5e4f93bd3e6e5500a8b8338d6249a2 (patch) | |
tree | 2aadaa0640b4910b78b1e1e99718f220fbfa7622 /plugins/Ping/src/log.cpp | |
parent | 3dc4db00aa828d245e4f7a8a14233d624f3e2e7c (diff) |
cleanup
git-svn-id: http://svn.miranda-ng.org/main/trunk@13625 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Ping/src/log.cpp')
-rw-r--r-- | plugins/Ping/src/log.cpp | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/plugins/Ping/src/log.cpp b/plugins/Ping/src/log.cpp index 65695872b9..cc9a166947 100644 --- a/plugins/Ping/src/log.cpp +++ b/plugins/Ping/src/log.cpp @@ -7,7 +7,7 @@ INT_PTR Log(WPARAM wParam, LPARAM) { //char TBcapt[255];
SYSTEMTIME systime;
-
+
GetLocalTime(&systime);
GetTimeFormat(LOCALE_USER_DEFAULT, 0, &systime, 0, tbuf, 512);
@@ -16,10 +16,11 @@ INT_PTR Log(WPARAM wParam, LPARAM) { TCHAR *line = (TCHAR *)wParam;
FILE *f = _tfopen(buf, _T("a+"));
- if(f) {
- if(options.log_csv) {
+ if (f) {
+ if (options.log_csv) {
_ftprintf(f, _T("%s, %s, %s\n"), dbuf, tbuf, line);
- } else {
+ }
+ else {
_ftprintf(f, _T("%s, %s: %s\n"), dbuf, tbuf, line);
}
fclose(f);
@@ -31,11 +32,12 @@ INT_PTR Log(WPARAM wParam, LPARAM) { INT_PTR GetLogFilename(WPARAM wParam, LPARAM lParam) {
DBVARIANT dbv;
TCHAR *filename = (TCHAR *)lParam;
- if(db_get_ts(0, PLUG, "LogFilename", &dbv)) {
+ if (db_get_ts(0, PLUG, "LogFilename", &dbv)) {
CallService(MS_DB_GETPROFILEPATHT, wParam, (LPARAM)filename);
- _tcsncat(filename, _T("\\ping_log.txt"),wParam);
- } else {
- _tcsncpy(filename, dbv.ptszVal, wParam);
+ mir_tstrncat(filename, _T("\\ping_log.txt"), _TRUNCATE);
+ }
+ else {
+ mir_tstrncpy(filename, dbv.ptszVal, wParam);
db_free(&dbv);
}
@@ -52,6 +54,6 @@ INT_PTR SetLogFilename(WPARAM, LPARAM lParam) { INT_PTR ViewLogData(WPARAM wParam, LPARAM) {
TCHAR buf[MAX_PATH];
CallService(PLUG "/GetLogFilename", (WPARAM)MAX_PATH, (LPARAM)buf);
- return (INT_PTR)ShellExecute((HWND)wParam, _T("edit"), buf, _T(""), _T(""), SW_SHOW);
+ return (INT_PTR)ShellExecute((HWND)wParam, _T("edit"), buf, _T(""), _T(""), SW_SHOW);
}
|