mirror of
https://git.jabber.space/devs/cproof.git
synced 2026-07-21 15:46:20 +00:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user