diff --git a/src/impl/getcomputername.cpp b/src/impl/getcomputername.cpp index 1ec69110c2..6b3d348ae5 100644 --- a/src/impl/getcomputername.cpp +++ b/src/impl/getcomputername.cpp @@ -1,12 +1,19 @@ #include "getcomputername.h" #include +#include BOOL GetComputerName(LPTSTR name, LPDWORD len) { + errno = 0; + int host = gethostname(name, HOST_NAME_MAX); if(host == 0) { return TRUE; - } - return FALSE; + } + else + { + errno = ERROR_BUFFER_OVERFLOW; + return FALSE; + } }