Fix error handling in read_file()

This commit is contained in:
hasufell 2014-05-09 14:27:28 +02:00
parent 5b5eea7f03
commit 03fca66adc
No known key found for this signature in database
GPG Key ID: 220CD1C5BDEED020
1 changed files with 1 additions and 1 deletions

View File

@ -67,7 +67,7 @@ char *read_file(char const * const filename)
objfile = open(filename, O_RDONLY);
if (objfile) {
if (objfile != -1) {
/* read and copy chunks */
while ((n = read(objfile, buf, STD_FILE_BUF)) > 0) {
char *tmp_ptr = NULL;