diff options
Diffstat (limited to 'libmysql')
-rw-r--r-- | libmysql/libmysql.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/libmysql/libmysql.c b/libmysql/libmysql.c index 190652c1d61..4d7d8a380a7 100644 --- a/libmysql/libmysql.c +++ b/libmysql/libmysql.c @@ -452,8 +452,9 @@ void read_user_name(char *name) void read_user_name(char *name) { - char *str=getenv("USER"); /* ODBC will send user variable */ - strmake(name,str ? str : "ODBC", USERNAME_LENGTH); + DWORD len= USERNAME_LENGTH; + if (!GetUserName(name, &len)) + strmov(name,"UNKNOWN_USER"); } #endif |