diff options
Diffstat (limited to 'src/config/preferences.c')
-rw-r--r-- | src/config/preferences.c | 24 |
1 files changed, 8 insertions, 16 deletions
diff --git a/src/config/preferences.c b/src/config/preferences.c index 6af779db..edbf6f63 100644 --- a/src/config/preferences.c +++ b/src/config/preferences.c @@ -1182,30 +1182,22 @@ prefs_clear_roster_private_char(void) g_key_file_remove_key(prefs, PREF_GROUP_UI, "roster.private.char", NULL); } -char +char* prefs_get_roster_room_char(void) { - char result = 0; - - char* resultstr = g_key_file_get_string(prefs, PREF_GROUP_UI, "roster.rooms.char", NULL); - if (!resultstr) { - result = 0; - } else { - result = resultstr[0]; - } - free(resultstr); + char* result = g_key_file_get_string(prefs, PREF_GROUP_UI, "roster.rooms.char", NULL); return result; } void -prefs_set_roster_room_char(char ch) +prefs_set_roster_room_char(char* ch) { - char str[2]; - str[0] = ch; - str[1] = '\0'; - - g_key_file_set_string(prefs, PREF_GROUP_UI, "roster.rooms.char", str); + if (g_utf8_strlen(ch, 4) == 1) { + g_key_file_set_string(prefs, PREF_GROUP_UI, "roster.rooms.char", ch); + } else { + log_error("Could not set roster resource char: %s", ch); + } } void |