diff --git a/a.out b/a.out deleted file mode 100755 index 532a570..0000000 Binary files a/a.out and /dev/null differ diff --git a/getfuncs.c b/getfuncs.c index f2e4113..b378556 100644 --- a/getfuncs.c +++ b/getfuncs.c @@ -8,9 +8,9 @@ int getFileLength(){ /*variables*/ FILE* stream; - int length = 0; + int file_length = 0; char* line = NULL; - size_t len = 0; + size_t length = 0; ssize_t read; /*prog*/ @@ -19,12 +19,12 @@ int getFileLength(){ return EXIT_FAILURE; } - while((read = getline(&line, &len, stream)) != -1){ - length++; + while((read = getline(&line, &length, stream)) != -1){ + file_length++; } fclose(stream); - return length-1; + return file_length-1; } /* @@ -37,7 +37,7 @@ int fetchWord(char* fullword, int file_length){ char read[8]; unsigned int counter = 0; int char_size = (int) sizeof(char); - int lign=0; + int line=0; int offset=0; /*prog*/ @@ -47,14 +47,15 @@ int fetchWord(char* fullword, int file_length){ return -1; } - for(lign=0; lign