mirror of
https://codeberg.org/libreboot/lbmk.git
synced 2026-03-25 13:29:03 +02:00
util/nvmutil: tidy up rw_file_exact
Signed-off-by: Leah Rowe <leah@libreboot.org>
This commit is contained in:
@@ -1876,9 +1876,13 @@ rw_file_exact(int fd, u8 *mem, size_t nrw,
|
||||
if ((size_t)rc >= nrw)
|
||||
break;
|
||||
|
||||
if ((rv = prw(fd,
|
||||
mem + (size_t)rc, nrw - rc, off + rc, rw_type,
|
||||
loop_eagain, loop_eintr)) < 0)
|
||||
rv = prw(fd,
|
||||
mem + (size_t)rc,
|
||||
nrw - (size_t)rc,
|
||||
off + (off_t)rc,
|
||||
rw_type, loop_eagain, loop_eintr);
|
||||
|
||||
if (rv < 0)
|
||||
return -1;
|
||||
|
||||
/* Prevent theoretical overflow */
|
||||
|
||||
Reference in New Issue
Block a user