Use the saved returned value of sym_get_string_value() instead of calling it twice.
Unified · Split
| @@ -137,7 +137,7 @@ static int conf_string(struct menu *menu) · 136 unmodified lines | |||
| 137 | printf("%*s%s ", indent - 1, "", menu->prompt->text); | 137 | printf("%*s%s ", indent - 1, "", menu->prompt->text); |
| 138 | printf("(%s) ", sym->name); | 138 | printf("(%s) ", sym->name); |
| 139 | def = sym_get_string_value(sym); | 139 | def = sym_get_string_value(sym); |
| 140 | if (sym_get_string_value(sym)) | 140 | if (def) |
| 141 | printf("[%s] ", def); | 141 | printf("[%s] ", def); |
| 142 | if (!conf_askvalue(sym, def)) | 142 | if (!conf_askvalue(sym, def)) |
| 143 | return 0; | 143 | return 0; |