Problem detected by the Coverity tool
CID 1042546 (#1 of 1): Argument cannot be negative (NEGATIVE_RETURNS)3.
negative_returns: "initial_pos" is passed to a parameter that cannot be
negative.
fseek(3) can't be called with a negative offset with SEEK_SET
uint8_t block_header[4];
int rc;
bool external = false;
- long file_size, initial_pos = ftell(image);
+ long file_size, initial_pos;
+
+ initial_pos = ftell(image);
+ if (initial_pos < 0)
+ return -1;
fseek(image, 0L, SEEK_END);
file_size = ftell(image);
-#define LIBUSB_NANO 10845
+#define LIBUSB_NANO 10846