diff options
author | Kenneth Venken <kenneth.venken@gmail.com> | 2010-10-17 00:13:19 -0500 |
---|---|---|
committer | Norbert Thiebaud <nthiebaud@gmail.com> | 2010-10-17 00:13:19 -0500 |
commit | a36dcb29132d4f8a0fc740a7714aec34ed53b8ce (patch) | |
tree | e00f9936cd53f3375e82816e2eb5d3e349f3eb18 /desktop/win32 | |
parent | 3d361dbc2d69484657c42852dcfa426c00bc3175 (diff) |
use SAL_N_ELEMENTS macro
Diffstat (limited to 'desktop/win32')
-rw-r--r-- | desktop/win32/source/guistdio/guistdio.inc | 3 | ||||
-rw-r--r-- | desktop/win32/source/officeloader/officeloader.cxx | 3 | ||||
-rw-r--r-- | desktop/win32/source/rebase/rebase.cxx | 5 |
3 files changed, 7 insertions, 4 deletions
diff --git a/desktop/win32/source/guistdio/guistdio.inc b/desktop/win32/source/guistdio/guistdio.inc index 7f2bbe9002d8..7009b24a0dc4 100644 --- a/desktop/win32/source/guistdio/guistdio.inc +++ b/desktop/win32/source/guistdio/guistdio.inc @@ -43,6 +43,7 @@ #include <systools/win32/uwinapi.h> #include <stdio.h> +#include <sal/macros.h> #ifdef UNOPKG @@ -358,7 +359,7 @@ int _tmain( int, _TCHAR ** ) { size_t len = lpLastDot - szModuleFileName; _tcsncpy( szTargetFileName, szModuleFileName, len ); - _tcsncpy( szTargetFileName + len, _T(".EXE"), sizeof(szTargetFileName)/sizeof(szTargetFileName[0]) - len ); + _tcsncpy( szTargetFileName + len, _T(".EXE"), SAL_N_ELEMENTS(szTargetFileName) - len ); } // Create process with same command line, environment and stdio handles which diff --git a/desktop/win32/source/officeloader/officeloader.cxx b/desktop/win32/source/officeloader/officeloader.cxx index d0880df4d874..0588814a9076 100644 --- a/desktop/win32/source/officeloader/officeloader.cxx +++ b/desktop/win32/source/officeloader/officeloader.cxx @@ -51,6 +51,7 @@ #include <systools/win32/uwinapi.h> #include "rtl/string.h" +#include <sal/macros.h> #include "../../../source/inc/exithelper.hxx" #include "../extendloaderenvironment.hxx" @@ -201,7 +202,7 @@ int WINAPI _tWinMain( HINSTANCE, HINSTANCE, LPTSTR, int ) { size_t len = lpLastSlash - szModuleFileName + 1; _tcsncpy( szPerfTuneIniFile, szModuleFileName, len ); - _tcsncpy( szPerfTuneIniFile + len, _T("perftune.ini"), sizeof(szPerfTuneIniFile)/sizeof(szPerfTuneIniFile[0]) - len ); + _tcsncpy( szPerfTuneIniFile + len, _T("perftune.ini"), SAL_N_ELEMENTS(szPerfTuneIniFile) - len ); } // Create process with same command line, environment and stdio handles which diff --git a/desktop/win32/source/rebase/rebase.cxx b/desktop/win32/source/rebase/rebase.cxx index b9dc64420e99..ba6c3937227a 100644 --- a/desktop/win32/source/rebase/rebase.cxx +++ b/desktop/win32/source/rebase/rebase.cxx @@ -44,6 +44,7 @@ #include <time.h> #include "sal/config.h" +#include <sal/macros.h> #include "tools/pathutils.hxx" #define MY_LENGTH(s) (sizeof (s) / sizeof *(s) - 1) @@ -120,7 +121,7 @@ void rebaseImagesInFolder( wchar_t* pszFolder, DWORD nNewImageBase ) { size_t len = lpLastSlash - pszFolder + 1; wcsncpy( szPattern, pszFolder, len ); - wcsncpy( szPattern + len, TEXT("*.dll"), sizeof(szPattern)/sizeof(szPattern[0]) - len ); + wcsncpy( szPattern + len, TEXT("*.dll"), SAL_N_ELEMENTS(szPattern) - len ); } WIN32_FIND_DATA aFindFileData; @@ -138,7 +139,7 @@ void rebaseImagesInFolder( wchar_t* pszFolder, DWORD nNewImageBase ) { size_t len = lpLastSlash - pszFolder + 1; wcsncpy( szLibFilePath, pszFolder, len ); - wcsncpy( szLibFilePath + len, aFindFileData.cFileName, sizeof(szLibFilePath)/sizeof(szLibFilePath[0]) - len ); + wcsncpy( szLibFilePath + len, aFindFileData.cFileName, SAL_N_ELEMENTS(szLibFilePath) - len ); } rebaseImage( szLibFilePath, nNewImageBase ); |