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 16c321c..246d9b4 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