From 90bc9b46847645fae17681b12df6305a28d9c73a Mon Sep 17 00:00:00 2001 From: Gluzskiy Alexandr Date: Mon, 30 Jul 2012 00:39:09 +0300 Subject: trivial fixes --- src/FileViewer.cpp | 8 ++++---- src/main.cpp | 8 ++++---- src/utils.cpp | 1 - 3 files changed, 8 insertions(+), 9 deletions(-) (limited to 'src') diff --git a/src/FileViewer.cpp b/src/FileViewer.cpp index b7765b6..191f744 100755 --- a/src/FileViewer.cpp +++ b/src/FileViewer.cpp @@ -710,11 +710,11 @@ bool bLoadFile( HWND hwndDlg , CLHistoryDlg * pclDlg ) if( nDBCount == -1 ) { - _stprintf( szTmp , _T("Failed to open file\r\n%s\r\n\r\nContact handle is invalid") , pclDlg->sPath.c_str() ); + mir_sntprintf(szTmp, 1499, _T("Failed to open file\r\n%s\r\n\r\nContact handle is invalid") , pclDlg->sPath.c_str()); } else { - _stprintf( szTmp , _T("Failed to open file\r\n%s\r\n\r\nMiranda database contains %d events") , pclDlg->sPath.c_str() , nDBCount ); + mir_sntprintf( szTmp , 1499, _T("Failed to open file\r\n%s\r\n\r\nMiranda database contains %d events") , pclDlg->sPath.c_str() , nDBCount ); } SETTEXTEX stText = {0}; @@ -784,7 +784,7 @@ bool bLoadFile( HWND hwndDlg , CLHistoryDlg * pclDlg ) //delete [] pabFileData; _TCHAR szTmp[100]; - _stprintf( szTmp , _T("File open time %d\n") , GetTickCount() - dwStart ); + mir_sntprintf( szTmp , 99, _T("File open time %d\n") , GetTickCount() - dwStart ); OutputDebugString( szTmp ); @@ -798,7 +798,7 @@ bool bLoadFile( HWND hwndDlg , CLHistoryDlg * pclDlg ) if( ! bScrollToBottom ) SendMessage( hRichEdit , EM_SETSCROLLPOS , 0 , (LPARAM) &ptOldPos ); - _stprintf( szTmp , _T("With scroll to bottom %d\n") , GetTickCount() - dwStart ); + mir_sntprintf( szTmp , 99, _T("With scroll to bottom %d\n") , GetTickCount() - dwStart ); OutputDebugString( szTmp ); return true; diff --git a/src/main.cpp b/src/main.cpp index c49623d..5d9ce23 100755 --- a/src/main.cpp +++ b/src/main.cpp @@ -343,8 +343,8 @@ int __declspec(dllexport)Load() if( bReplaceHistory ) { -/* hServiceFunc = CreateServiceFunction(MS_HISTORY_SHOWCONTACTHISTORY,ShowExportHistory); //this need new code - if( hServiceFunc ) + hServiceFunc = CreateServiceFunction(MS_HISTORY_SHOWCONTACTHISTORY,ShowExportHistory); //this need new code +/* if( hServiceFunc ) { int *disableDefaultModule=(int*)CallService(MS_PLUGINS_GETDISABLEDEFAULTARRAY,0,0); if( disableDefaultModule ) @@ -356,9 +356,9 @@ int __declspec(dllexport)Load() DestroyServiceFunction( hServiceFunc ); hServiceFunc = 0; } - } + }*/ - if( ! hServiceFunc ) */ + if( ! hServiceFunc ) MessageBox( NULL , TranslateTS(_T("Failed to replace Miranda History.\r\nThis is most likely due to changes in Miranda.")) , MSG_BOX_TITEL , MB_OK ); } diff --git a/src/utils.cpp b/src/utils.cpp index 3643d2c..15ed559 100755 --- a/src/utils.cpp +++ b/src/utils.cpp @@ -582,7 +582,6 @@ bool bReadMirandaDirAndPath() tmp2 = mir_utf8decodeT(tmp); sMirandaPath = tmp2; sMirandaPath.erase(sMirandaPath.find_last_of(_T("\\"))); - mir_free(tmp); CallService(MS_DB_GETPROFILEPATHT, (WPARAM)MAX_PATH - 1, (LPARAM)szDBPath); sDBPath = szDBPath; CallService(MS_DB_GETPROFILENAMET, (WPARAM)MAX_PATH - 1, (LPARAM)szDBPath); -- cgit v1.2.3