Initialization

This commit is contained in:
Kozar 2024-04-25 18:56:41 +02:00
parent 212c9690a2
commit 29ca99a838

View File

@ -22,7 +22,7 @@ int main() {
i = 0;
while (i < count && fgets(buffer, sizeof(buffer), stdin)) {
int len = strlen(buffer);
if (buffer[len - 1] == '\n') { // Remove newline character if present
if (len > 0 && buffer[len - 1] == '\n') { // Remove newline character if present
buffer[len - 1] = '\0';
}
int found = 0;