diff --git a/du6/program.c b/du6/program.c index b7a2870..b18f611 100644 --- a/du6/program.c +++ b/du6/program.c @@ -60,13 +60,13 @@ int main() { puts("Ziadne prihlasky"); } for (int j = 0; j < i; j++) { - for (int j = 0; j < i; j++) { - if (strcmp(database[j], database[j]) < 0) { + for (int k = 0; k < i; k++) { + if (strcmp(database[j], database[k]) < 0) { char buffer[30]; - memset(buffer, 0, sizeof(buffer)); + //memset(buffer, 0, sizeof(buffer)); strcpy(buffer, database[j]); - strcpy(database[j], database[j]); - strcpy(database[j], buffer); + strcpy(database[j], database[k]); + strcpy(database[k], buffer); } } }