From 5c6d8f47dc257f389d5f9b550e5e74c7742f865d Mon Sep 17 00:00:00 2001 From: Maryna Kravtsova Date: Sat, 21 Nov 2020 18:36:39 +0100 Subject: [PATCH] buffet --- cv8/program.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/cv8/program.c b/cv8/program.c index e64c482..e69ebff 100644 --- a/cv8/program.c +++ b/cv8/program.c @@ -4,16 +4,16 @@ #include struct tree { - char value[20]; + char value[30]; struct tree* left; struct tree* right; }; struct tree* read_tree(){ - char buffer[20]; - memset(buffer,0,20); - char* r = fgets(buffer,20,stdin); + char buffer[30]; + memset(buffer,0,30); + char* r = fgets(buffer,30,stdin); int x = strlen(buffer); buffer[x-1]='\0'; @@ -23,7 +23,7 @@ struct tree* read_tree(){ if(buffer[0] == '\0'){ return node; } - memcpy(node->value, buffer, 20); + memcpy(node->value, buffer,30); if(buffer[0] != '*'){ if(node->left == NULL){ node->left = read_tree();