From fc82d99f7b349cbf39636843a2c2fbec9aa05ae8 Mon Sep 17 00:00:00 2001 From: weirdo12 Date: Mon, 23 Feb 2026 14:06:53 -0500 Subject: [PATCH] Update PJSysInfo.pas GetComputerName() returns a null character so it requires and wants to know there is space for it. Without the + 1 in the assignment to Size, a valid name like DESKTOP-0123456 that is exactly MAX_COMPUTERNAME_LENGTH characters in length is returned as an empty string. --- PJSysInfo.pas | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/PJSysInfo.pas b/PJSysInfo.pas index be46898..68e6ff2 100644 --- a/PJSysInfo.pas +++ b/PJSysInfo.pas @@ -4785,10 +4785,10 @@ class function TPJComputerInfo.BootMode: TPJBootMode; class function TPJComputerInfo.ComputerName: string; var PComputerName: // buffer for name returned from API - array[0..MAX_COMPUTERNAME_LENGTH] of Char; + array[0..MAX_COMPUTERNAME_LENGTH] of Char; Size: DWORD; // size of name buffer begin - Size := MAX_COMPUTERNAME_LENGTH; + Size := MAX_COMPUTERNAME_LENGTH + 1; if GetComputerName(PComputerName, Size) then Result := PComputerName else