From 6f2d67a8e1480df3f4e75edd28689feaaf96ccb8 Mon Sep 17 00:00:00 2001 From: Maryna Kravtsova Date: Thu, 3 Dec 2020 15:25:17 +0100 Subject: [PATCH] telegrafista --- a5/program.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/a5/program.c b/a5/program.c index 106d327..a52efcd 100644 --- a/a5/program.c +++ b/a5/program.c @@ -65,7 +65,10 @@ void search(struct morsetree* root, char* decode){ printf("\n"); return; }*/ - if(decode[i+1] == ' ' || decode[i+1] == '\n' || decode[i+1] == '\0'){ + if(decode[i] == ' ' || decode[i] == '\n' || decode[i] == '\0'){ + if(i == strlen(decode)){ + return; + } printf("%c", this->letter); this = root; }