mirror of
https://github.com/shadow-maint/shadow.git
synced 2024-11-24 02:24:32 +08:00
fread returns element count, not element size
This commit is contained in:
parent
bd102eaa35
commit
ffd35d8902
@ -168,7 +168,7 @@ static long read_random_bytes (void)
|
||||
#else
|
||||
FILE *f = fopen ("/dev/urandom", "r");
|
||||
|
||||
if (fread (&randval, sizeof (randval), 1, f) != sizeof (randval)) {
|
||||
if (fread (&randval, sizeof (randval), 1, f) != 1) {
|
||||
fclose(f);
|
||||
goto fail;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user