read_file: introduce read_file_2
read_file has some limitations:

- It is not possible to check the error code since read_file returns
  NULL for failure
- It is not possible to limit the buffer size to sensible limits.

This patch introduces read_file_2 which doesn't have these limitations.
read_file becomes a wrapper around read_file_2.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
1 parent 3cfa4bc commit 28ce918d96f5de657e88eb54f87edf441ab2caa5
@Sascha Hauer Sascha Hauer authored on 30 Jul 2014
Showing 2 changed files
View
include/libfile.h
View
lib/libfile.c