Очистка буффера при новой команде

This commit is contained in:
2026-06-11 13:18:07 +03:00
parent 795a123c88
commit 617f296307
2 changed files with 3 additions and 0 deletions
BIN
View File
Binary file not shown.
+3
View File
@@ -37,7 +37,10 @@ bool runCommand(char* command) {
return false; return false;
} }
// Clean
out_i = 0; out_i = 0;
memset(out, 0, sizeof(out));
// Read the output a line at a time and store it in the out array // Read the output a line at a time and store it in the out array
while (fgets(path, sizeof(path), fp) != NULL) { while (fgets(path, sizeof(path), fp) != NULL) {
strncpy(out[out_i], path, 100); strncpy(out[out_i], path, 100);