mirror of
https://github.com/Tha14/toxic.git
synced 2025-07-03 01:06:44 +02:00
modularize string arrays for line completion
Instead of using various different forms of string arrays and having to handle them differently for string completion, we now always use char pointer arrays. This allows us to remove some large stack allocations, remove a bunch of confusing defines that keep track of global array sizes, and generally unclutters the code so it's easier to read.
This commit is contained in:
@ -794,6 +794,7 @@ static Tox *load_tox(char *data_path, struct Tox_Options *tox_opts, Tox_Err_New
|
||||
|
||||
if (plain == NULL) {
|
||||
fclose(fp);
|
||||
free(data);
|
||||
exit_toxic_err("failed in load_tox", FATALERR_MEMORY);
|
||||
return NULL;
|
||||
}
|
||||
@ -812,6 +813,7 @@ static Tox *load_tox(char *data_path, struct Tox_Options *tox_opts, Tox_Err_New
|
||||
if (strcasecmp(user_password.pass, "q") == 0) {
|
||||
fclose(fp);
|
||||
free(plain);
|
||||
free(data);
|
||||
exit(0);
|
||||
}
|
||||
|
||||
@ -1294,7 +1296,7 @@ static int rename_old_profile(const char *user_config_dir)
|
||||
return -1;
|
||||
}
|
||||
|
||||
snprintf(old_data_blocklist, sizeof(old_data_blocklist), "%s%s%s", user_config_dir, CONFIGDIR, OLD_DATA_BLOCKLIST_NAME);
|
||||
snprintf(old_data_blocklist, old_block_buf_size, "%s%s%s", user_config_dir, CONFIGDIR, OLD_DATA_BLOCKLIST_NAME);
|
||||
|
||||
if (!file_exists(old_data_blocklist)) {
|
||||
free(old_data_blocklist);
|
||||
|
Reference in New Issue
Block a user