summaryrefslogtreecommitdiff
path: root/utils.c
diff options
context:
space:
mode:
Diffstat (limited to 'utils.c')
-rw-r--r--utils.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/utils.c b/utils.c
index 4a2b4ce..54800bc 100644
--- a/utils.c
+++ b/utils.c
@@ -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);
}