diff options
author | rafa_99 <rafa99@protonmail.com> | 2020-11-22 14:41:29 +0000 |
---|---|---|
committer | rafa_99 <rafa99@protonmail.com> | 2020-11-22 14:41:29 +0000 |
commit | 2e4fb93e33b92e5546c6d17a53743ac3cfb7e86b (patch) | |
tree | da66091e2ac5ba43a453c6bc2c1e1d36ebfd859a /utils.c | |
parent | 7b644262f9ef0b5e5d5f5463b9cf96b78b67bfed (diff) |
Fixed Some Memory Leaks
Diffstat (limited to 'utils.c')
-rw-r--r-- | utils.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -15,9 +15,10 @@ int lineCounter(FILE *dictionary) if ( dictionary != NULL ) { char line[MAX_LINE]; - for( words; (!feof(dictionary)); words++ ) + for( int i = words; (!feof(dictionary)); i++ ) { fgets(line, MAX_LINE, dictionary); + words = i; } rewind(dictionary); words--; @@ -41,6 +42,5 @@ char* getLine(FILE *dictionary, int lineNumber) int getRandomNumber(int min, int max) { - srand(time(0)); return ((rand() % (max - min + 1)) + 1); } |