[CONSRV]: Use string-safe functions to copy the font names into the fixed-size buffers.
[reactos.git] / reactos / win32ss / user / winsrv / consrv / frontends / gui / guisettings.c
index b57491c..b61d84e 100644 (file)
@@ -156,11 +156,13 @@ GuiConsoleShowConsoleProperties(PGUI_CONSOLE_DATA GuiData,
             pSharedInfo->ScreenAttributes = DEFAULT_SCREEN_ATTRIB;
             pSharedInfo->PopupAttributes  = DEFAULT_POPUP_ATTRIB ;
         }
-        /// pSharedInfo->CodePage;
+
+        /* We display the output code page only */
+        pSharedInfo->CodePage = Console->OutputCodePage;
 
         /* GUI Information */
-        wcsncpy(pSharedInfo->FaceName, GuiData->GuiInfo.FaceName, LF_FACESIZE);
-        pSharedInfo->FaceName[LF_FACESIZE - 1] = UNICODE_NULL;
+        StringCchCopyNW(pSharedInfo->FaceName, ARRAYSIZE(pSharedInfo->FaceName),
+                        GuiData->GuiInfo.FaceName, ARRAYSIZE(GuiData->GuiInfo.FaceName));
         pSharedInfo->FontFamily = GuiData->GuiInfo.FontFamily;
         pSharedInfo->FontSize   = GuiData->GuiInfo.FontSize;
         pSharedInfo->FontWeight = GuiData->GuiInfo.FontWeight;
@@ -317,7 +319,7 @@ GuiApplyUserSettings(PGUI_CONSOLE_DATA GuiData,
         ConInfo.HistoryBufferSize = pConInfo->HistoryBufferSize;
         ConInfo.NumberOfHistoryBuffers = pConInfo->NumberOfHistoryBuffers;
         ConInfo.HistoryNoDup = !!pConInfo->HistoryNoDup;
-        ConInfo.CodePage = pConInfo->CodePage;
+        ConInfo.CodePage = pConInfo->CodePage; // Done in ConSrvApplyUserSettings
 #endif
 
         /*