summaryrefslogtreecommitdiffstats
path: root/common/filetype.c
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2012-04-17 22:05:37 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2012-04-17 22:05:37 +0200
commit3170433558133269d5a4a9017c51df33c86d0ea5 (patch)
treedb947eec9e8c53db3b4ffe9476aded889804da92 /common/filetype.c
parent86b9eb2105578eaecba52ca419c8670a51b70e99 (diff)
parent1d79f322f7a3bff9b6b9bde4ce7f391f0316063a (diff)
downloadbarebox-3170433558133269d5a4a9017c51df33c86d0ea5.tar.gz
Merge branch 'master' into next
Diffstat (limited to 'common/filetype.c')
-rw-r--r--common/filetype.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/common/filetype.c b/common/filetype.c
index b784bff..0120913 100644
--- a/common/filetype.c
+++ b/common/filetype.c
@@ -89,10 +89,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);