Skip to content

Commit

Permalink
config_save_file - simplification in snprintf call in loop
Browse files Browse the repository at this point in the history
  • Loading branch information
LibretroAdmin committed Sep 1, 2022
1 parent 6f84af2 commit 77e83a4
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions configuration.c
Original file line number Diff line number Diff line change
Expand Up @@ -4736,14 +4736,16 @@ bool config_save_file(const char *path)
}

#ifdef HAVE_NETWORKGAMEPAD
for (i = 0; i < MAX_USERS; i++)
{
char tmp[64];
size_t _len = strlcpy(tmp, "network_remote_enable_user_p", sizeof(tmp));
snprintf(tmp + _len, sizeof(tmp) - _len, "%u", i + 1);
config_set_string(conf, tmp,
settings->bools.network_remote_enable_user[i]
? "true" : "false");
for (i = 0; i < MAX_USERS; i++)
{
snprintf(tmp + _len, sizeof(tmp) - _len, "%u", i + 1);
config_set_string(conf, tmp,
settings->bools.network_remote_enable_user[i]
? "true" : "false");
}
}
#endif

Expand Down

0 comments on commit 77e83a4

Please sign in to comment.