mirror of
https://github.com/utmapp/libusb.git
synced 2026-12-01 14:01:17 -10: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:
1 parent
e678b3fad5
commit
00454ab087
3 files changed
+7
-3
No files matched your search
@@ -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,\
|
||||
|
||||
+6
-1
@@ -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