diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2014-03-04 13:47:20 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2014-03-04 13:47:20 +0100 |
commit | 8f210c26c53cf5480819d983e57977d531422ff1 (patch) | |
tree | 22600c4c469fe0882fd206f2c79864845b3ab04c /sal | |
parent | 3dcf6647109feeaa199e64d30a71407e225be582 (diff) |
coverity#706154 is about call to strcpy, not osl_ProfileGenerateExtension
...and the call to strcpy isn't even necessary. This includes a revert of
430237b3fa16bda228ff82b93228f28894568671 "coverity#706154: Dest buffer too
small."
Change-Id: I51186da6e7d80438b01d49e24a1fa47877078516
Diffstat (limited to 'sal')
-rw-r--r-- | sal/osl/unx/profile.cxx | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/sal/osl/unx/profile.cxx b/sal/osl/unx/profile.cxx index 53f0757e7686..2ee461e95410 100644 --- a/sal/osl/unx/profile.cxx +++ b/sal/osl/unx/profile.cxx @@ -2020,26 +2020,21 @@ static sal_Bool osl_ProfileSwapProfileNames(osl_TProfileImpl* pProfile) sal_Char pszBakFile[PATH_MAX]; sal_Char pszTmpFile[PATH_MAX]; - sal_Char pszIniFile[PATH_MAX]; pszBakFile[0] = '\0'; pszTmpFile[0] = '\0'; - pszIniFile[0] = '\0'; - osl_ProfileGenerateExtension(pProfile->m_FileName, "bak", pszBakFile, PATH_MAX - 1); - - strcpy(pszIniFile, pProfile->m_FileName); - - osl_ProfileGenerateExtension(pProfile->m_FileName, "tmp", pszTmpFile, PATH_MAX - 1); + osl_ProfileGenerateExtension(pProfile->m_FileName, "bak", pszBakFile, PATH_MAX); + osl_ProfileGenerateExtension(pProfile->m_FileName, "tmp", pszTmpFile, PATH_MAX); /* unlink bak */ unlink( pszBakFile ); /* rename ini bak */ - rename( pszIniFile, pszBakFile ); + rename( pProfile->m_FileName, pszBakFile ); /* rename tmp ini */ - rename( pszTmpFile, pszIniFile ); + rename( pszTmpFile, pProfile->m_FileName ); return bRet; } |