get_real_name fix from nh <nhwith@bonbon.net>
authorPekka Riikonen <priikone@silcnet.org>
Tue, 25 Jul 2006 06:14:05 +0000 (06:14 +0000)
committerPekka Riikonen <priikone@silcnet.org>
Tue, 25 Jul 2006 06:14:05 +0000 (06:14 +0000)
lib/silcutil/unix/silcunixutil.c

index 15356c52b92b474f40b0f5e01c27a709920ad948..c20ebdb876f8175542fbaf07692f1c1df90a93d5 100644 (file)
@@ -160,11 +160,14 @@ char *silc_get_real_name()
     
   pw = getpwuid(getuid());
   if (!pw)
-     return strdup("Foo T. Bar");
+    return strdup("No Name");
 
   if (strchr(pw->pw_gecos, ','))
     *strchr(pw->pw_gecos, ',') = 0;
 
+  if (!strlen(pw->pw_gecos))
+    return strdup("No Name");
+
   realname = strdup(pw->pw_gecos);
 
   return realname;