diff options
Diffstat (limited to 'src/config/preferences.c')
-rw-r--r-- | src/config/preferences.c | 23 |
1 files changed, 8 insertions, 15 deletions
diff --git a/src/config/preferences.c b/src/config/preferences.c index b1686424..fae150c8 100644 --- a/src/config/preferences.c +++ b/src/config/preferences.c @@ -902,30 +902,23 @@ prefs_get_occupants_size(void) } } -char +char* prefs_get_occupants_char(void) { - char result = 0; - char* resultstr = g_key_file_get_string(prefs, PREF_GROUP_UI, "occupants.char", NULL); - if (!resultstr) { - result = 0; - } else { - result = resultstr[0]; - } - free(resultstr); + char* result = g_key_file_get_string(prefs, PREF_GROUP_UI, "occupants.char", NULL); return result; } void -prefs_set_occupants_char(char ch) +prefs_set_occupants_char(char* ch) { - char str[2]; - str[0] = ch; - str[1] = '\0'; - - g_key_file_set_string(prefs, PREF_GROUP_UI, "occupants.char", str); + if (g_utf8_strlen(ch, 4) == 1) { + g_key_file_set_string(prefs, PREF_GROUP_UI, "occupants.char", ch); + } else { + log_error("Could not set roster resource char: %s", ch); + } } void |