From 2ee05597ced59d313fbfe7b6054a82ff52447e5a Mon Sep 17 00:00:00 2001 From: Pekka Riikonen Date: Mon, 18 Jun 2001 12:21:29 +0000 Subject: [PATCH] updates. --- lib/silcutil/silcutil.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/lib/silcutil/silcutil.c b/lib/silcutil/silcutil.c index 5f21beeb..9da9aea4 100644 --- a/lib/silcutil/silcutil.c +++ b/lib/silcutil/silcutil.c @@ -731,12 +731,7 @@ char *silc_get_username() { char *logname = NULL; - if (!getenv("LOGNAME")) { - fprintf(stderr, "Error: environment variable $LOGNAME not set\n"); - return NULL; - } - - logname = strdup(getenv("LOGNAME")); + logname = getenv("LOGNAME"); if (!logname) { logname = getlogin(); if (!logname) { @@ -748,11 +743,11 @@ char *silc_get_username() return NULL; } - logname = strdup(pw->pw_name); + logname = pw->pw_name; } } - return logname; + return strdup(logname); } /* Returns the real name of ther user. */ -- 2.24.0