chiark / gitweb /
disorder.h: more consistent approach to function attributes
[disorder] / lib / wav.c
index 8b2d640a044bee70fabcea46085b542727872b8a..fe7ffbbf0443289018bf2852dbc5c364f5f5e764 100644 (file)
--- a/lib/wav.c
+++ b/lib/wav.c
@@ -129,7 +129,7 @@ int wav_init(struct wavfile *f, const char *path) {
   
   memset(f, 0, sizeof *f);
   f->data = -1;
-  hreader_init(path, f->input);
+  if(hreader_init(path, f->input)) goto error_errno;
   /* Read the file header
    *
    *  offset  size  meaning
@@ -196,7 +196,8 @@ error:
 }
 
 /** @brief Close a WAV file */
-void wav_destroy(struct wavfile attribute((unused)) *f) {
+void wav_destroy(struct wavfile *f) {
+  hreader_close(f->input);
 }
 
 /** @brief Visit all the data in a WAV file