Index: /trunk/src/VBox/Main/MachineImpl.cpp
===================================================================
--- /trunk/src/VBox/Main/MachineImpl.cpp	(revision 15999)
+++ /trunk/src/VBox/Main/MachineImpl.cpp	(revision 16000)
@@ -102,5 +102,5 @@
  *  (when loading a newly created settings file, validation will be turned off)
  */
-static const char DefaultMachineConfig[] =
+static const char gDefaultMachineConfig[] =
 {
     "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>" RTFILE_LINEFEED
@@ -5803,6 +5803,6 @@
         {
             vrc = RTFileWrite (mData->mHandleCfgFile,
-                               (void *) DefaultMachineConfig,
-                               sizeof (DefaultMachineConfig), NULL);
+                               (void *) gDefaultMachineConfig,
+                               strlen (gDefaultMachineConfig), NULL);
         }
         if (RT_FAILURE (vrc))
Index: /trunk/src/VBox/Main/VirtualBoxImpl.cpp
===================================================================
--- /trunk/src/VBox/Main/VirtualBoxImpl.cpp	(revision 15999)
+++ /trunk/src/VBox/Main/VirtualBoxImpl.cpp	(revision 16000)
@@ -200,5 +200,5 @@
                 vrc = RTFileWrite (handle,
                                    (void *) gDefaultGlobalConfig,
-                                   sizeof (gDefaultGlobalConfig), NULL);
+                                   strlen (gDefaultGlobalConfig), NULL);
             if (RT_FAILURE (vrc))
             {
