examples/utils.c: exit if an output file could not be opened
authorPaul Brossier <piem@piem.org>
Mon, 11 Feb 2013 03:30:15 +0000 (22:30 -0500)
committerPaul Brossier <piem@piem.org>
Mon, 11 Feb 2013 03:30:15 +0000 (22:30 -0500)
examples/utils.c

index 16c321cbadaba712ba8061dbcc14f1b336eb02a0..246d9b43a58f1a06e2b21254b70d52b0fd9a2658 100644 (file)
@@ -209,6 +209,10 @@ examples_common_init (int argc, char **argv)
     samplerate = aubio_source_get_samplerate(this_source);
     if (sink_uri != NULL) {
       this_sink = new_aubio_sink ((char_t*)sink_uri, samplerate);
+      if (this_sink == NULL) {
+        outmsg ("Could not open output file %s.\n", sink_uri);
+        exit (1);
+      }
     }
   }
 #ifdef HAVE_LASH