diff --git a/du6/program.c b/du6/program.c index 6157f4a..25b8cd8 100644 --- a/du6/program.c +++ b/du6/program.c @@ -31,11 +31,12 @@ int main() //memset(pole_smernikov,0,SIZE*sizeof(char*)); int k = 0; char* line = malloc(wSIZE * sizeof(char)); - memset(line,0,SIZE); + //memset(line,0,SIZE); //char* r; //int q = 0; - int pocet_znakov = 0; - while (fgets(line,SIZE,stdin)) { + size_t pocet_znakov = 0; + while (fgets(line,wSIZE,stdin)) { + k = 0; pocet_znakov = strlen(line); char* all = malloc(pocet_znakov); memcpy(all, line, pocet_znakov); @@ -50,6 +51,7 @@ int main() pm++; } } + free(line); k = 0; int i = 0; i = 0;