diff --git a/a5/program.c b/a5/program.c index 1a45126..3b2f2d1 100644 --- a/a5/program.c +++ b/a5/program.c @@ -60,6 +60,7 @@ void search(struct morsetree* root, char* decode){ int i = 0; for(i == 0; i <= strlen(decode); i++){ if(i == strlen(decode) && decode[strlen(decode)-1] == ' '){ + printf("\n"); return; } if(decode[i] == ' ' || decode[i] == '\n' || decode[i] == '\0'){ @@ -79,7 +80,7 @@ void search(struct morsetree* root, char* decode){ } } - printf("\n"); + } @@ -129,6 +130,7 @@ int main (){ fgets(line, MAX, stdin); line[strlen(line)-1] = '\0'; if(line[0] == '\0'){ + printf("\n"); destroy(root); return 0; }