diff options
Diffstat (limited to 'man3/getpwnam.3')
| -rw-r--r-- | man3/getpwnam.3 | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/man3/getpwnam.3 b/man3/getpwnam.3 index e65a6cd358..3d0c195633 100644 --- a/man3/getpwnam.3 +++ b/man3/getpwnam.3 @@ -289,7 +289,7 @@ supplied as a command-line argument. #include <stdio.h> #include <stdlib.h> #include <unistd.h> - +\& int main(int argc, char *argv[]) { @@ -298,22 +298,22 @@ main(int argc, char *argv[]) char *buf; long bufsize; int s; - +\& if (argc != 2) { fprintf(stderr, "Usage: %s username\en", argv[0]); exit(EXIT_FAILURE); } - +\& bufsize = sysconf(_SC_GETPW_R_SIZE_MAX); if (bufsize == \-1) /* Value was indeterminate */ bufsize = 16384; /* Should be more than enough */ - +\& buf = malloc(bufsize); if (buf == NULL) { perror("malloc"); exit(EXIT_FAILURE); } - +\& s = getpwnam_r(argv[1], &pwd, buf, bufsize, &result); if (result == NULL) { if (s == 0) @@ -324,7 +324,7 @@ main(int argc, char *argv[]) } exit(EXIT_FAILURE); } - +\& printf("Name: %s; UID: %jd\en", pwd.pw_gecos, (intmax_t) pwd.pw_uid); exit(EXIT_SUCCESS); |
