telegrafista

This commit is contained in:
Maryna Kravtsova 2020-12-03 15:12:11 +01:00
parent 0492549d34
commit b9a9f2551d

View File

@ -60,6 +60,7 @@ void search(struct morsetree* root, char* decode){
int i = 0; int i = 0;
for(i == 0; i <= strlen(decode); i++){ for(i == 0; i <= strlen(decode); i++){
if(i == strlen(decode) && decode[strlen(decode)-1] == ' '){ if(i == strlen(decode) && decode[strlen(decode)-1] == ' '){
printf("\n");
return; return;
} }
if(decode[i] == ' ' || decode[i] == '\n' || decode[i] == '\0'){ 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); fgets(line, MAX, stdin);
line[strlen(line)-1] = '\0'; line[strlen(line)-1] = '\0';
if(line[0] == '\0'){ if(line[0] == '\0'){
printf("\n");
destroy(root); destroy(root);
return 0; return 0;
} }