Sophie

Sophie

distrib > Mandriva > current > i586 > media > contrib-release-src > by-pkgid > c525ed1db92056fe6e28088d6ba99538 > files > 2

ocaml-mad-0.3.6-1mdv2010.1.src.rpm

diff -Naur -x '*.orig' -x '*~' ocaml-mad-0.3.6/src/mad_stubs.c ocaml-mad-0.3.6-openfile/src/mad_stubs.c
--- ocaml-mad-0.3.6/src/mad_stubs.c	2009-10-12 11:07:26.000000000 +0200
+++ ocaml-mad-0.3.6-openfile/src/mad_stubs.c	2010-01-25 21:34:39.000000000 +0100
@@ -159,6 +159,11 @@
   CAMLlocal1(block);
   madfile_t *mf;
   FILE *fd = fopen(String_val(file), "r");
+  if (fd == NULL) {
+    char err_buf[256];
+    snprintf(err_buf, 256, "Error: couldn't open file \"%s\"", String_val(file));
+    caml_failwith(err_buf);
+  }
 
   if (!fd)
     caml_raise_with_arg(*caml_named_value("mad_exn_openfile_error"),