Handle read_data errors correctly
authorJonathan Dieter <jdieter@gmail.com>
Tue, 4 Apr 2023 20:11:12 +0000 (21:11 +0100)
committerJonathan Dieter <jdieter@gmail.com>
Tue, 4 Apr 2023 20:11:12 +0000 (21:11 +0100)
commite9e393ae40d016541d28ba7059d33a4fffb2e6ed
tree4f47a277a2906dd45fb21f350aff95b0c1dd25fa
parent1829fd18c9626254c266b87212715dae7cedc5fb
Handle read_data errors correctly

The read_data function returns the number of bytes written, not a boolean,
so fix the error checking so we exit if fewer than expected bytes were
read.  Thanks to Agostino Sarubbo of Gentoo for providing a bug report with
a reproducible test case.

Signed-off-by: Jonathan Dieter <jdieter@gmail.com>
src/lib/header.c