summaryrefslogtreecommitdiff
path: root/util
diff options
context:
space:
mode:
authorLeah Rowe <leah@libreboot.org>2026-03-13 05:51:48 +0000
committerLeah Rowe <leah@libreboot.org>2026-03-26 06:59:41 +0000
commita0ca693d4210e1e9c2508096b391c7d8a5017aeb (patch)
treeab9adb94999e9325a7402e606fae11a36eee31e3 /util
parent1dbd679c0cd6e412b4ccd97b14eceb44a4598048 (diff)
util/nvmutil: increment rc at end of rw_file_exact
for fussy static analysers and/or compilers Signed-off-by: Leah Rowe <leah@libreboot.org>
Diffstat (limited to 'util')
-rw-r--r--util/nvmutil/nvmutil.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/util/nvmutil/nvmutil.c b/util/nvmutil/nvmutil.c
index 058657d9..811cce31 100644
--- a/util/nvmutil/nvmutil.c
+++ b/util/nvmutil/nvmutil.c
@@ -1564,9 +1564,11 @@ rw_file_exact(int fd, uint8_t *mem, size_t len,
return -1;
}
- for (rc = 0, rv = 0; rc < len; rc += (size_t)rv) {
+ for (rc = 0, rv = 0; rc < len; ) {
if ((rv = rw_file_once(fd, mem, len, off, rw_type, rc)) == -1)
return -1;
+
+ rc += (size_t)rv;
}
return rc;