shithub: sox

Download patch

ref: 01452b2729962800a6d655daa4eea4821ab5ddd3
parent: 16071e06627a4b52f0342d6dea5a7443d2e56722
author: robs <robs>
date: Sat Nov 25 15:50:20 EST 2006

Don't refer to file info after st_close.

--- a/src/sox.c
+++ b/src/sox.c
@@ -891,7 +891,11 @@
          * we are exiting anyways.
          */
         if (st_close(file_desc[f]) == ST_EOF)
-            st_warn("%s", file_desc[f]->st_errstr);
+        {
+          /* We no longer have any info about this file as we've just
+           * st_close'd it, so just refer to file number: */
+          st_warn("Input file # %i reported an error whilst it was being closed.", f);
+        }
     }
 
     if (writing)
@@ -900,7 +904,11 @@
          * are exiting anyways.
          */
         if (st_close(file_desc[file_count-1]) == ST_EOF)
-            st_warn("%s", file_desc[file_count-1]->st_errstr);
+        {
+          /* We no longer have any info about this file as we've just
+           * st_close'd it, so just refer to it as the "Output file": */
+          st_warn("Output file reported an error whilst it was being closed.");
+        }
     }
 }