You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This happens because realname_os() is copy-pasted from username_os(), with GetUserNameW replaced with GetUserNameExW. But unlike GetUserNameW, GetUserNameExW on success returns the number of characters NOT counting the null terminator.
The text was updated successfully, but these errors were encountered:
To reproduce, run the following program:
or
It fails:
The assertion is here: https://github.com/libcala/whoami/blob/14f0e4a4cebb5debf7284da5b83152689161857c/src/windows.rs#L149
This happens because
realname_os()
is copy-pasted fromusername_os()
, withGetUserNameW
replaced withGetUserNameExW
. But unlikeGetUserNameW
,GetUserNameExW
on success returns the number of characters NOT counting the null terminator.The text was updated successfully, but these errors were encountered: