diff options
Diffstat (limited to 'session.c')
-rw-r--r-- | session.c | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -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(); } } } |