mirror of
https://github.com/shadps4-emu/ext-libusb.git
synced 2026-01-31 00:55:21 +01:00
examples/ezusb: Replace rewind with fseek, to check for errors
Replace rewind, which gives no error result, with fseek, which does. Fixes all clang-tidy bugprone-unsafe-functions warnings References #1479
This commit is contained in:
committed by
Tormod Volden
parent
e678b3fad5
commit
00454ab087
@@ -13,7 +13,6 @@ bugprone-*,\
|
||||
-bugprone-signed-char-misuse,\
|
||||
-bugprone-suspicious-string-compare,\
|
||||
-bugprone-switch-missing-default-case,\
|
||||
-bugprone-unsafe-functions,\
|
||||
-bugprone-too-small-loop-variable,\
|
||||
clang-analyzer-*,\
|
||||
-clang-analyzer-core.NullDereference,\
|
||||
|
||||
@@ -815,7 +815,12 @@ int ezusb_load_ram(libusb_device_handle *device, const char *path, int fx_type,
|
||||
}
|
||||
|
||||
/* at least write the interrupt vectors (at 0x0000) for reset! */
|
||||
rewind(image);
|
||||
status = fseek(image, 0L, SEEK_SET);
|
||||
if (ret < 0) {
|
||||
logerror("unable to rewind file %s\n", path);
|
||||
ret = status;
|
||||
goto exit;
|
||||
}
|
||||
if (verbose)
|
||||
logerror("2nd stage: write on-chip memory\n");
|
||||
status = parse_ihex(image, &ctx, is_external, ram_poke);
|
||||
|
||||
@@ -1 +1 @@
|
||||
#define LIBUSB_NANO 11913
|
||||
#define LIBUSB_NANO 11914
|
||||
|
||||
Reference in New Issue
Block a user