GetComputerName fails on Windows with max length computer name


#1
String SystemStats::getComputerName()
{
    TCHAR text [MAX_COMPUTERNAME_LENGTH + 1] = { 0 };
    DWORD len = (DWORD) numElementsInArray (text) - 1;
    GetComputerName (text, &len);
    return String (text, len);
}

That -1 shouldn't be there. 

On input, specifies the size of the buffer, in TCHARs. On output, the number of TCHARs copied to the destination buffer, not including the terminating null character.

On input it should be buffer size, on output it is number of characters.


#2

Thanks, will get that fixed!