Use more generic variable names in read_files()

This commit is contained in:
hasufell 2014-05-10 20:25:24 +02:00
parent 723155a2ce
commit 4bcbb69fc7
No known key found for this signature in database
GPG Key ID: 220CD1C5BDEED020
1 changed files with 5 additions and 5 deletions

View File

@ -68,15 +68,15 @@ char *read_file(char const * const filename)
{
char buf[STD_FILE_BUF],
*string = NULL;
int objfile = 0;
int fd = 0;
size_t str_size = 0;
ssize_t n;
objfile = open(filename, O_RDONLY);
fd = open(filename, O_RDONLY);
if (objfile != -1) {
if (fd != -1) {
/* read and copy chunks */
while ((n = read(objfile, buf, STD_FILE_BUF)) > 0) {
while ((n = read(fd, buf, STD_FILE_BUF)) > 0) {
char *tmp_ptr = NULL;
str_size += n; /* count total bytes read */
@ -94,7 +94,7 @@ char *read_file(char const * const filename)
/* add trailing NULL byte */
string[str_size] = '\0';
close(objfile);
close(fd);
return string;
} else {