Return errors on open functions

Signed-off-by: TheJackiMonster <thejackimonster@gmail.com>
This commit is contained in:
TheJackiMonster 2023-09-08 13:04:05 +02:00
parent 2bd57ee0dd
commit b074ab72fc
No known key found for this signature in database
GPG key ID: D850A5F772E880F9
8 changed files with 72 additions and 90 deletions

View file

@ -67,14 +67,13 @@ int main(int argc, const char** argv) {
return 0;
}
device4_type* dev4 = device4_open(NULL);
if (!dev4) {
device4_type dev4;
if (DEVICE4_ERROR_NO_ERROR != device4_open(&dev4, NULL)) {
return 1;
}
device4_clear(dev4);
device4_update_mcu_firmware(dev4, path);
device4_close(dev4);
device4_clear(&dev4);
device4_update_mcu_firmware(&dev4, path);
device4_close(&dev4);
return 0;
}