VirtualBox

Changeset 16000 in vbox for trunk/src


Ignore:
Timestamp:
Jan 16, 2009 4:51:34 PM (16 years ago)
Author:
vboxsync
Message:

Main: Don't write a zero char to the end of a virgin global or machine XML settings file when creating it.

Location:
trunk/src/VBox/Main
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/MachineImpl.cpp

    r15994 r16000  
    102102 *  (when loading a newly created settings file, validation will be turned off)
    103103 */
    104 static const char DefaultMachineConfig[] =
     104static const char gDefaultMachineConfig[] =
    105105{
    106106    "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>" RTFILE_LINEFEED
     
    58035803        {
    58045804            vrc = RTFileWrite (mData->mHandleCfgFile,
    5805                                (void *) DefaultMachineConfig,
    5806                                sizeof (DefaultMachineConfig), NULL);
     5805                               (void *) gDefaultMachineConfig,
     5806                               strlen (gDefaultMachineConfig), NULL);
    58075807        }
    58085808        if (RT_FAILURE (vrc))
  • trunk/src/VBox/Main/VirtualBoxImpl.cpp

    r15366 r16000  
    200200                vrc = RTFileWrite (handle,
    201201                                   (void *) gDefaultGlobalConfig,
    202                                    sizeof (gDefaultGlobalConfig), NULL);
     202                                   strlen (gDefaultGlobalConfig), NULL);
    203203            if (RT_FAILURE (vrc))
    204204            {
Note: See TracChangeset for help on using the changeset viewer.

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