exit(1);
}
#endif
+ if (!pw)
+ {
+ fprintf(stderr,
+ _("%s: could not obtain information about current user: %s\n"),
+ progname, strerror(errno));
+ exit(1);
+ }
#else /* the windows code */
struct passwd_win32
DWORD pwname_size = sizeof(pass_win32.pw_name) - 1;
pw->pw_uid = 1;
- GetUserName(pw->pw_name, &pwname_size);
+ if (!GetUserName(pw->pw_name, &pwname_size))
+ {
+ fprintf(stderr, _("%s: could not get current user name: %s\n"),
+ progname, strerror(errno));
+ exit(1);
+ }
#endif
return xstrdup(pw->pw_name);