From 1c8c62ce20e50b84a72228970a8761d5c4e8302d Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Sun, 27 Oct 2019 07:07:35 -0400 Subject: Cleanup: consider lseek return value This seems excessively unlikely to actually fail. SEEK_END works, but SEEK_SET fails? Oh well. Belts and suspenders. Found by Coverity. Fixes CID 45039 Signed-off-by: Dirk Hohndel --- core/uemis-downloader.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'core') diff --git a/core/uemis-downloader.c b/core/uemis-downloader.c index 180115271..18aa2451b 100644 --- a/core/uemis-downloader.c +++ b/core/uemis-downloader.c @@ -232,13 +232,13 @@ static void uemis_info(const char *fmt, ...) static long bytes_available(int file) { - long result; + long result, r2; long now = lseek(file, 0, SEEK_CUR); if (now == -1) return 0; result = lseek(file, 0, SEEK_END); - lseek(file, now, SEEK_SET); - if (now == -1 || result == -1) + r2 = lseek(file, now, SEEK_SET); + if (now == -1 || result == -1 || r2 == -1) return 0; return result; } -- cgit v1.2.3-70-g09d2