From 236d1063a36b34587c12b08c4bf228346d8ba937 Mon Sep 17 00:00:00 2001 From: Maryna Kravtsova Date: Sun, 22 Nov 2020 13:04:50 +0100 Subject: [PATCH] buffet --- cv8/program.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/cv8/program.c b/cv8/program.c index fe06d0f..1522de0 100644 --- a/cv8/program.c +++ b/cv8/program.c @@ -49,8 +49,9 @@ struct tree* search(struct tree* this){ }*/ char c = getchar(); char buffer[50]; - buffer[strlen(buffer)-1]='\0'; - + memset(buffer, 0, 50); + int x = strlen(buffer); + buffer[x-1]='\0'; memcpy(buffer, this->value, 50); //printf("%s\n", buffer); if(buffer[0] != '*'){