Uninitialized vector entry?
[minix3.git] / lib / other / getlogin.c
blobfe0a34e45ff444905f37d85e24bc2be11196b494
1 /* getlogin(3)
3 * Author: Terrence W. Holm Aug. 1988
4 */
6 #include <lib.h>
7 #include <pwd.h>
8 #include <unistd.h>
9 #include <string.h>
10 #include <stdio.h>
12 #ifndef L_cuserid
13 #define L_cuserid 9
14 #endif
16 char *getlogin()
18 PRIVATE char userid[L_cuserid];
19 struct passwd *pw_entry;
21 pw_entry = getpwuid(getuid());
23 if (pw_entry == (struct passwd *)NULL) return((char *)NULL);
25 strcpy(userid, pw_entry->pw_name);
27 return(userid);