Skip to content

Commit

Permalink
Addition to prev. revision [#METR-23279].
Browse files Browse the repository at this point in the history
  • Loading branch information
alexey-milovidov committed Oct 24, 2016
1 parent a081f5f commit 1527176
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions dbms/src/Interpreters/ClientInfo.cpp
Expand Up @@ -101,8 +101,8 @@ void ClientInfo::read(ReadBuffer & in)

void ClientInfo::fillOSUserHostNameAndVersionInfo()
{
os_user.resize(L_cuserid + 1, '\0');
if (0 != getlogin_r(&os_user[0], L_cuserid))
os_user.resize(256, '\0');
if (0 == getlogin_r(&os_user[0], os_user.size() - 1))
os_user.resize(strlen(os_user.data()));
else
os_user.clear(); /// Don't mind if we cannot determine user login.
Expand Down

0 comments on commit 1527176

Please sign in to comment.