This is a brown paper bag type of bugs. Do not assume that a file has to be at minimun 512 bytes to be detectable. Signed-off-by: Sascha Hauer <s.hauer@xxxxxxxxxxxxxx> --- common/filetype.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/common/filetype.c b/common/filetype.c index 4b5a6fa..15a3732 100644 --- a/common/filetype.c +++ b/common/filetype.c @@ -92,10 +92,10 @@ enum filetype file_name_detect_type(const char *filename) if (fd < 0) return fd; - buf = xmalloc(512); + buf = xzalloc(512); ret = read(fd, buf, 512); - if (ret != 512) + if (ret < 0) goto err_out; type = file_detect_type(buf); -- 1.7.10 _______________________________________________ barebox mailing list barebox@xxxxxxxxxxxxxxxxxxx http://lists.infradead.org/mailman/listinfo/barebox