Небольшие изменения
This commit is contained in:
parent
0a23530d71
commit
f0b7a6d61f
@ -2,7 +2,6 @@
|
|||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <unistd.h>
|
|
||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
|
|
||||||
#include "c_cross_pack/libs/threads.h"
|
#include "c_cross_pack/libs/threads.h"
|
||||||
@ -15,8 +14,10 @@
|
|||||||
char comment[1000] = "";
|
char comment[1000] = "";
|
||||||
char command[10000] = "";
|
char command[10000] = "";
|
||||||
|
|
||||||
|
#define OUT_LEN 1000 // 1000 items with 100 symbol len
|
||||||
|
int out_len = OUT_LEN;
|
||||||
// Output of command execution
|
// Output of command execution
|
||||||
char out[1000][100];
|
char out[OUT_LEN][100];
|
||||||
int out_i = 0;
|
int out_i = 0;
|
||||||
|
|
||||||
bool runCommand(char* command) {
|
bool runCommand(char* command) {
|
||||||
@ -40,7 +41,7 @@ bool runCommand(char* command) {
|
|||||||
strncpy(out[out_i], path, 100);
|
strncpy(out[out_i], path, 100);
|
||||||
out[out_i][99] = '\0'; // Ensure null termination
|
out[out_i][99] = '\0'; // Ensure null termination
|
||||||
out_i++;
|
out_i++;
|
||||||
if (out_i >= 1000) {
|
if (out_i >= out_len) {
|
||||||
break; // Prevent overflow
|
break; // Prevent overflow
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user