Change char->free to auto_char char for autocleanup

Replace `gchar` and `g_free` to `auto_gchar`
Correct certain  `char` functions/variables to `gchar`

Related to #1819.

Edited by @jubalh.
This commit is contained in:
John Hernandez
2023-07-11 13:23:58 +02:00
parent 245d69deb6
commit e1d137f4e6
62 changed files with 498 additions and 969 deletions

View File

@@ -51,7 +51,7 @@ _parse_args_helper(const char* const inp, int min, int max, gboolean* result, gb
}
// copy and strip input of leading/trailing whitespace
char* copy = strdup(inp);
auto_char char* copy = strdup(inp);
g_strstrip(copy);
int inp_size = g_utf8_strlen(copy, -1);
@@ -135,8 +135,6 @@ _parse_args_helper(const char* const inp, int min, int max, gboolean* result, gb
tokens = g_slist_append(tokens, g_strndup(token_start, token_size));
}
free(copy);
int num = g_slist_length(tokens) - 1;
// if num args not valid return NULL