Reduce size of some char variables and get rid of some implicit memsets

This commit is contained in:
twinaphex 2016-10-27 09:44:20 +02:00
parent c1b59df7ae
commit f017593501
5 changed files with 16 additions and 10 deletions

View File

@ -1283,7 +1283,9 @@ static void config_set_defaults(void)
if (!string_is_empty(g_defaults.dir.osk_overlay))
{
char temp_path[PATH_MAX_LENGTH] = {0};
char temp_path[PATH_MAX_LENGTH];
temp_path[0] = '\0';
fill_pathname_expand_special(temp_path,
g_defaults.dir.osk_overlay, sizeof(temp_path));
@ -1299,7 +1301,9 @@ static void config_set_defaults(void)
}
else
{
char temp_path[PATH_MAX_LENGTH] = {0};
char temp_path[PATH_MAX_LENGTH];
temp_path[0] = '\0';
strlcpy(temp_path,
settings->directory.overlay,
@ -1708,10 +1712,10 @@ static bool config_load_file(const char *path, bool set_defaults,
settings_t *settings)
{
unsigned i;
char tmp_str[PATH_MAX_LENGTH];
bool ret = false;
bool tmp_bool = false;
char *save = NULL;
char tmp_str[PATH_MAX_LENGTH];
unsigned msg_color = 0;
config_file_t *conf = NULL;
struct config_int_setting *int_settings = NULL;
@ -2265,7 +2269,9 @@ bool config_load_override(void)
/* If a game override exists, add it's location to append_config_path */
if (new_conf)
{
char temp_path[PATH_MAX_LENGTH] = {0};
char temp_path[PATH_MAX_LENGTH];
temp_path[0] = '\0';
config_file_free(new_conf);

View File

@ -55,8 +55,8 @@
struct string_list *dir_list_new_special(const char *input_dir,
enum dir_list_type type, const char *filter)
{
char ext_shaders[PATH_MAX_LENGTH];
char ext_name[PATH_MAX_LENGTH];
char ext_shaders[255];
char ext_name[255];
const char *dir = NULL;
const char *exts = NULL;
bool include_dirs = false;

View File

@ -247,7 +247,7 @@ bool playlist_push(playlist_t *playlist,
{
if (string_is_empty(core_name) && !string_is_empty(core_path))
{
static char base_path[PATH_MAX_LENGTH] = {0};
static char base_path[255] = {0};
fill_pathname_base_noext(base_path, core_path, sizeof(base_path));
core_name = base_path;
RARCH_LOG("core_name is now: %s\n", core_name);

View File

@ -228,7 +228,7 @@ static void retroarch_print_features(void)
static void retroarch_print_version(void)
{
char str[PATH_MAX_LENGTH];
char str[255];
str[0] = '\0';
@ -1026,7 +1026,7 @@ bool retroarch_main_init(int argc, char *argv[])
if (verbosity_is_enabled())
{
char str[PATH_MAX_LENGTH];
char str[255];
str[0] = '\0';

View File

@ -237,7 +237,7 @@ static bool runloop_cmd_get_state_menu_toggle_button_combo(
**/
static bool rarch_game_specific_options(char **output)
{
char game_path[PATH_MAX_LENGTH];
char game_path[255];
game_path[0] ='\0';