Skip to content

Commit

Permalink
Prevent crash when no output file is given with -S
Browse files Browse the repository at this point in the history
  • Loading branch information
zuckschwerdt committed Mar 24, 2016
1 parent abd8a16 commit c4c91fe
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/rtl_433.c
Original file line number Diff line number Diff line change
Expand Up @@ -1128,6 +1128,11 @@ int main(int argc, char **argv) {
fprintf(stderr, "WARNING: Failed to reset buffers.\n");

if (sync_mode) {
if (!demod->out_file) {
fprintf(stderr, "Specify an output file for sync mode.\n");
exit(0);
}

fprintf(stderr, "Reading samples in sync mode...\n");
uint8_t *buffer = malloc(out_block_size * sizeof (uint8_t));

Expand Down

0 comments on commit c4c91fe

Please sign in to comment.