Skip to content

Commit f5d9615

Browse files
committed
Remove exit() from dfu.c
1 parent 1ddd5bf commit f5d9615

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/dfu.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -281,8 +281,8 @@ int dfu_getstatus(struct dfu_dev *dfu, struct dfu_status *status)
281281
}
282282

283283
if (result > (int) sizeof(struct dfu_status)) {
284-
pmsg_error("oversize read (should not happen); exiting\n");
285-
exit(1);
284+
pmsg_error("oversize read (should not happen)\n");
285+
return -1;
286286
}
287287

288288
pmsg_trace("dfu_getstatus(): bStatus 0x%02x, bwPollTimeout %d, bState 0x%02x, iString %d\n",
@@ -382,8 +382,8 @@ int dfu_upload(struct dfu_dev *dfu, void *ptr, int size)
382382
}
383383

384384
if (result > size) {
385-
pmsg_error("oversize read (should not happen); exiting\n");
386-
exit(1);
385+
pmsg_error("oversize read (should not happen)\n");
386+
return -1;
387387
}
388388

389389
return 0;

0 commit comments

Comments
 (0)