From f0b7a6d61fd6ffd99146bbc40b0a0d8666833cc1 Mon Sep 17 00:00:00 2001 From: justuser-31 Date: Sat, 15 Feb 2025 09:38:11 +0300 Subject: [PATCH] =?UTF-8?q?=D0=9D=D0=B5=D0=B1=D0=BE=D0=BB=D1=8C=D1=88?= =?UTF-8?q?=D0=B8=D0=B5=20=D0=B8=D0=B7=D0=BC=D0=B5=D0=BD=D0=B5=D0=BD=D0=B8?= =?UTF-8?q?=D1=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- rtracker.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/rtracker.c b/rtracker.c index 19e9f49..5f102e7 100644 --- a/rtracker.c +++ b/rtracker.c @@ -2,7 +2,6 @@ #include #include #include -#include #include #include "c_cross_pack/libs/threads.h" @@ -15,8 +14,10 @@ char comment[1000] = ""; char command[10000] = ""; +#define OUT_LEN 1000 // 1000 items with 100 symbol len +int out_len = OUT_LEN; // Output of command execution -char out[1000][100]; +char out[OUT_LEN][100]; int out_i = 0; bool runCommand(char* command) { @@ -40,7 +41,7 @@ bool runCommand(char* command) { strncpy(out[out_i], path, 100); out[out_i][99] = '\0'; // Ensure null termination out_i++; - if (out_i >= 1000) { + if (out_i >= out_len) { break; // Prevent overflow } }