From 7ffe8a12a2d2502f6f46b16c5d6bdcd1ba8346b1 Mon Sep 17 00:00:00 2001 From: EmeraldLockdown <86802223+EmeraldLoc@users.noreply.github.com> Date: Thu, 19 Mar 2026 19:27:41 -0500 Subject: [PATCH] Zero clue where that change appeared from magically --- src/pc/utils/misc.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/src/pc/utils/misc.c b/src/pc/utils/misc.c index 5543d62be..81366887d 100644 --- a/src/pc/utils/misc.c +++ b/src/pc/utils/misc.c @@ -550,7 +550,7 @@ void str_seperator_concat(char *output_buffer, int buffer_size, char** strings, memset(output_buffer, 0, buffer_size); if (num_strings <= 0) { return; } - // calculate the total length of all strings + // Calculate the total length of all strings int string_length[num_strings]; int total_length = 0; for (int i = 0; i < num_strings; i++) { @@ -562,7 +562,7 @@ void str_seperator_concat(char *output_buffer, int buffer_size, char** strings, int seperator_length = strlen(seperator); int seperators_length = (num_strings - 1) * seperator_length; if (seperators_length + 8 < buffer_size) { - // shorten the largest string over and over until we fit + // Shorten the largest string over and over until we fit while (total_length + seperators_length >= buffer_size) { int* largest = NULL; for (int i = 0; i < num_strings; i++) { @@ -576,16 +576,16 @@ void str_seperator_concat(char *output_buffer, int buffer_size, char** strings, } } - // fill the buffer + // Fill the buffer int buffer_index = 0; for (int i = 0; i < num_strings; i++) { - // concat string + // Concat string int amount = MIN(buffer_size - buffer_index, string_length[i] + 1); if (amount <= 0) { break; } snprintf(&output_buffer[buffer_index], amount, "%s", strings[i]); buffer_index += string_length[i]; - // concat seperator + // Concat seperator if (i != (num_strings - 1)) { int amount = MIN(buffer_size - buffer_index, seperator_length + 1); if (amount <= 0) { break; } @@ -593,6 +593,4 @@ void str_seperator_concat(char *output_buffer, int buffer_size, char** strings, buffer_index += seperator_length; } } - - output_buffer += buffer_index; -} +} \ No newline at end of file