mirror of
https://github.com/Tha14/toxic.git
synced 2024-11-23 02:23:02 +01:00
Fixed emptying avatar_path if the path is too long.
This commit is contained in:
parent
89f200e870
commit
a561ef8c49
@ -289,7 +289,7 @@ int settings_load(struct user_settings *s, const char *patharg)
|
|||||||
|
|
||||||
if ( config_setting_lookup_string(setting, tox_strings.avatar_path, &str) ) {
|
if ( config_setting_lookup_string(setting, tox_strings.avatar_path, &str) ) {
|
||||||
snprintf(s->avatar_path, sizeof(s->avatar_path), "%s", str);
|
snprintf(s->avatar_path, sizeof(s->avatar_path), "%s", str);
|
||||||
int len = strlen(s->avatar_path);
|
int len = strlen(str);
|
||||||
|
|
||||||
if (len >= sizeof(s->avatar_path))
|
if (len >= sizeof(s->avatar_path))
|
||||||
s->avatar_path[0] = '\0';
|
s->avatar_path[0] = '\0';
|
||||||
|
Loading…
Reference in New Issue
Block a user