shithub: sox

Download patch

ref: c33152a91bb39ba6230faf24b55715dcffbdc764
parent: 6ec486c191af37519fbf4823a78290e977114871
author: robs <robs>
date: Tue Mar 31 02:09:40 EDT 2009

fix bug when libmagic sometimes appends text

--- a/src/formats.c
+++ b/src/formats.c
@@ -100,7 +100,7 @@
     }
     if (magic)
       filetype = magic_buffer(magic, data, sizeof(data));
-    if (filetype && strcmp(filetype, "application/octet-stream") &&
+    if (filetype && strncmp(filetype, "application/octet-stream", (size_t)24) &&
           !lsx_strends(filetype, "/unknown") &&
           strncmp(filetype, "text/plain", (size_t)10) )
       return filetype;