diff --git a/host/hackrf-tools/src/hackrf_sweep.c b/host/hackrf-tools/src/hackrf_sweep.c index 4ab3e72f..7a1bb871 100644 --- a/host/hackrf-tools/src/hackrf_sweep.c +++ b/host/hackrf-tools/src/hackrf_sweep.c @@ -757,7 +757,7 @@ int main(int argc, char** argv) { fprintf(stderr, "hackrf_exit() done\n"); } - if(fd != NULL) { + if ( ( fd != NULL ) && ( fd != stdout ) ) { fclose(fd); fd = NULL; fprintf(stderr, "fclose(fd) done\n");