fix redundant space and using ftell twice
This commit is contained in:
parent
7b58f36b39
commit
bf6923d24c
1 changed files with 3 additions and 3 deletions
2
ccc.c
2
ccc.c
|
@ -217,8 +217,8 @@ void show_file_content()
|
||||||
|
|
||||||
fseek(file, 0, SEEK_END);
|
fseek(file, 0, SEEK_END);
|
||||||
/* check if file isn't empty */
|
/* check if file isn't empty */
|
||||||
if (ftell(file) != 0) {
|
|
||||||
long length = ftell(file);
|
long length = ftell(file);
|
||||||
|
if (length != 0) {
|
||||||
fseek(file, 0, SEEK_SET);
|
fseek(file, 0, SEEK_SET);
|
||||||
|
|
||||||
char *buffer = memalloc(length * sizeof(char));
|
char *buffer = memalloc(length * sizeof(char));
|
||||||
|
|
Loading…
Reference in a new issue