summaryrefslogtreecommitdiff
path: root/session.c
diff options
context:
space:
mode:
Diffstat (limited to 'session.c')
-rw-r--r--session.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/session.c b/session.c
index 0b0c11d..b04958d 100644
--- a/session.c
+++ b/session.c
@@ -1,5 +1,6 @@
#include <stdio.h>
#include <stdlib.h>
+#include <string.h>
#include "session.h"
void startSession(FILE *dictionary)
@@ -7,16 +8,15 @@ void startSession(FILE *dictionary)
if ( dictionary != NULL )
{
int totalWords = lineCounter(dictionary);
- char* word = (char *) calloc(256, sizeof(char));
- char reload;
+ char *word;
+ char reload = '\0';
while( reload != 'q' )
{
word = getLine(dictionary, getRandomNumber(1, totalWords));
- printf("%s\n", word);
+ printf("%s", word);
free(word);
- //reload = getchar();
- //getchar();
+ reload = getchar();
}
}
}