option_get_valuestring: fix trailing whitespace for UNIT_INT

Remove trailing whitespace from int settings, so
that right-aligned or centered values look correct
in Quickscreen for settings such as Brightness.

Change-Id: I006cf3c3e8b30be2246e7370f26e0428fa47e54b
This commit is contained in:
Christian Soffke 2026-09-09 11:22:57 +02:00
parent 10ec9bd530
commit f2985dc8a2

View file

@ -108,7 +108,12 @@ const char *option_get_valuestring(const struct settings_list *setting,
if (formatter)
str = formatter(buffer, buf_len, (int)temp_var, str_unit);
else if (!is_time_setting)
snprintf(buffer, buf_len, "%d %s", (int)temp_var, str_unit?str_unit:"");
{
if (str_unit && str_unit[0])
snprintf(buffer, buf_len, "%d %s", (int)temp_var, str_unit);
else
snprintf(buffer, buf_len, "%d", (int)temp_var);
}
}
else if (HASFLAG(setting, F_T_SOUND))
{