VirtualBox

Changeset 28692 in vbox for trunk/src/VBox/Runtime/r3


Ignore:
Timestamp:
Apr 24, 2010 7:14:03 PM (15 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
60564
Message:

iprt: XmlFileWrite - expose the two suffixes write() uses when fSafe is set.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/r3/xml.cpp

    r28689 r28692  
    15341534        /* Construct both filenames first to ease error handling.  */
    15351535        char szTmpFilename[RTPATH_MAX];
    1536         int rc = RTStrCopy(szTmpFilename, sizeof(szTmpFilename) - sizeof("-tmp") + 1, pcszFilename);
     1536        int rc = RTStrCopy(szTmpFilename, sizeof(szTmpFilename) - strlen(s_pszTmpSuff), pcszFilename);
    15371537        if (RT_FAILURE(rc))
    15381538            throw EIPRTFailure(rc, "RTStrCopy");
    1539         strcat(szTmpFilename, "-tmp");
     1539        strcat(szTmpFilename, s_pszTmpSuff);
    15401540
    15411541        char szPrevFilename[RTPATH_MAX];
    1542         rc = RTStrCopy(szPrevFilename, sizeof(szPrevFilename) - sizeof("-prev") + 1, pcszFilename);
     1542        rc = RTStrCopy(szPrevFilename, sizeof(szPrevFilename) - strlen(s_pszPrevSuff), pcszFilename);
    15431543        if (RT_FAILURE(rc))
    15441544            throw EIPRTFailure(rc, "RTStrCopy");
    1545         strcat(szPrevFilename, "-prev");
     1545        strcat(szPrevFilename, s_pszPrevSuff);
    15461546
    15471547        /* Write the XML document to the temporary file.  */
     
    15911591}
    15921592
     1593/*static*/ const char * const XmlFileWriter::s_pszTmpSuff  = "-tmp";
     1594/*static*/ const char * const XmlFileWriter::s_pszPrevSuff = "-prev";
     1595
    15931596
    15941597} // end namespace xml
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette