diff --git a/a5/program.c b/a5/program.c index 324cab2..18d1337 100644 --- a/a5/program.c +++ b/a5/program.c @@ -59,6 +59,9 @@ void search(struct morsetree* root, char* decode){ struct morsetree* this = root; int i = 0; for(i == 0; i <= strlen(decode); i++){ + if(i == strlen(decode) && decode[strlen(decode)-1] == ' '){ + return; + } if(decode[i] == ' ' || decode[i] == '\n' || decode[i] == '\0'){ printf("%c", this->letter); this = root; @@ -76,7 +79,7 @@ void search(struct morsetree* root, char* decode){ } } - //return this; + } int main (){