From: Pekka Riikonen Date: Mon, 18 Jun 2001 12:21:29 +0000 (+0000) Subject: updates. X-Git-Tag: 1.2.beta1~2155 X-Git-Url: http://git.silcnet.org/gitweb/?a=commitdiff_plain;h=2ee05597ced59d313fbfe7b6054a82ff52447e5a;p=crypto.git updates. --- 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. */