Linting: Suppress warnings in os/users.c.

This commit is contained in:
Florian Walch 2014-11-26 15:04:33 +01:00 committed by Justin M. Keyes
parent 0f258e4453
commit ed9828140a

View File

@ -52,7 +52,7 @@ int os_get_uname(uid_t uid, char *s, size_t len)
#if defined(HAVE_PWD_H) && defined(HAVE_GETPWUID)
struct passwd *pw;
if ((pw = getpwuid(uid)) != NULL
if ((pw = getpwuid(uid)) != NULL // NOLINT(runtime/threadsafe_fn)
&& pw->pw_name != NULL && *(pw->pw_name) != NUL) {
STRLCPY(s, pw->pw_name, len);
return OK;
@ -72,7 +72,7 @@ char *os_get_user_directory(const char *name)
if (name == NULL) {
return NULL;
}
pw = getpwnam(name);
pw = getpwnam(name); // NOLINT(runtime/threadsafe_fn)
if (pw != NULL) {
// save the string from the static passwd entry into malloced memory
return xstrdup(pw->pw_dir);