libsepol: fix unitialized variable 'nread' on mac build

Fix this:
genusers.c:63:14: warning: variable 'nread' is uninitialized when used here [-Wuninitialized]
                if (buffer[nread - 1] == '\n')
                           ^~~~~
genusers.c:40:15: note: initialize the variable 'nread' to silence this warning
        ssize_t nread;
                     ^
                      = 0

Signed-off-by: William Roberts <william.c.roberts@intel.com>
This commit is contained in:
William Roberts 2016-09-23 13:55:52 -07:00 committed by Stephen Smalley
parent 87c5afdad2
commit d97cd6a203

View File

@ -53,6 +53,7 @@ static int load_users(struct policydb *policydb, const char *path)
}
while(fgets(buffer, 255, fp) != NULL) {
nread = strlen(buffer);
#else
size_t len = 0;
__fsetlocking(fp, FSETLOCKING_BYCALLER);