From 1c055b09226bdf20035400fbb7269a0927b30ad1 Mon Sep 17 00:00:00 2001 From: Igor Belitskiy Date: Mon, 26 Jun 2023 10:22:24 +0600 Subject: [PATCH] =?UTF-8?q?=D0=98=D1=81=D0=BF=D1=80=D0=B0=D0=B2=D0=B8?= =?UTF-8?q?=D0=BB=20=D0=B1=D0=B0=D0=B3=20=D1=81=20=D1=83=D0=B4=D0=B0=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=D0=B8=D0=B5=D0=BC=20=D0=B8=D0=B7=20=D1=82=D0=B0?= =?UTF-8?q?=D0=B1=D0=BB=D0=B8=D1=86=D1=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- source/ubl-settings-resourcequota.h | 2 +- source/ubl-utils.c | 24 +++++++++--------------- 2 files changed, 10 insertions(+), 16 deletions(-) diff --git a/source/ubl-settings-resourcequota.h b/source/ubl-settings-resourcequota.h index 0a6a4c6..04e9aad 100755 --- a/source/ubl-settings-resourcequota.h +++ b/source/ubl-settings-resourcequota.h @@ -43,7 +43,7 @@ #define CMD_GET_GROUP "cut -d: -f1 /etc/group" typedef char *string; -string version_application = "1.2-43-g3f8aab0"; +string version_application = "1.2-44-g708ecfc"; static char *local; diff --git a/source/ubl-utils.c b/source/ubl-utils.c index 8becf1d..f3ebf2a 100644 --- a/source/ubl-utils.c +++ b/source/ubl-utils.c @@ -671,7 +671,7 @@ void philos_split_size_memory(char* str_value, int* size, char* pow_memory) { } char* philos_format_cfg_str_size_memory(char* str_key, int value, int pow_size_memory) { - if (value == -1 || pow_size_memory == -3) { + if (value == -1 || value == -3 || pow_size_memory == -3) { return yon_char_new("-"); } char* str_value = yon_char_from_int(value); @@ -768,10 +768,10 @@ char*** yon_char_parsed_shrink_n3(char ***char_string, int *size, int item_to_de flag = 1; } if (flag == 0) { - yon_char_parsed_copy(&char_string[i], &new_char_parsed[i]); + yon_char_parsed_copy(&new_char_parsed[i],&char_string[i]); } else if (flag == 1 && i!=item_to_delete) { - yon_char_parsed_copy(&char_string[i], &new_char_parsed[i-1]); + yon_char_parsed_copy(&new_char_parsed[i-1], &char_string[i]); } } (*size)=(*size)-1; @@ -884,18 +884,12 @@ void yon_int_array_append(int **source, int append){ void philos_array_int_copy(int** source, int** copy) { int * new_int = g_malloc0(sizeof(int)*2); new_int[0] = (*copy)[0]; - if ((*copy)[0] == -2) { - yon_int_array_append(&new_int,(*copy)[0]); - } - else { - new_int[1] = -2; - int i = 2; - for (i=1;(*copy)[i]!=-2;i++) { - yon_int_array_append(&new_int,(*copy)[i]); - } + new_int[1] = -2; + int i = 2; + for (i=1;(*copy)[i]!=-2;i++) { + yon_int_array_append(&new_int,(*copy)[i]); } *source=new_int; - } // parsing functions @@ -1519,10 +1513,10 @@ int** remove_element_int_array_n3(int** array, int* size, int item_to_delete) { flag = 1; } if (flag == 0) { - philos_array_int_copy(&array[i],&new_int_parsed[i]); + philos_array_int_copy(&new_int_parsed[i],&array[i]); } else if (flag == 1 && i!=item_to_delete) { - philos_array_int_copy(&array[i],&new_int_parsed[i-1]); + philos_array_int_copy(&new_int_parsed[i-1],&array[i]); } } (*size)=(*size)-1;