X-Git-Url: https://git.deb.at/?a=blobdiff_plain;f=ui.c;h=20ec8feed48ecade9f964364e8815fefeb4a7064;hb=2f465ba5e73ba05745d23f0fca9d5bdb1b350d8c;hp=b4152699b560df0e02f664133c8ccf3520bd45f0;hpb=236cce04895dd0443012be918d7927e50bfb6aac;p=pkg%2Fabook.git diff --git a/ui.c b/ui.c index b415269..20ec8fe 100644 --- a/ui.c +++ b/ui.c @@ -248,8 +248,8 @@ statusline_addhlstr(const char *str) wattrset(bottom, (*p == '>') ? A_BOLD : A_NORMAL); tmp = xstrndup(start, p - start); mvwaddstr(bottom, 1, pos, tmp); + pos += strwidth(tmp); free(tmp); - pos += p - start; } if(*p) { start = p + 1; @@ -284,7 +284,7 @@ statusline_askchoice(const char *msg, const char *choices, short dflt) assert((dflt < 0) || (dflt > strlen(choices))); if(dflt) { - s = mkstr("%s [%c]", msg, choices[dflt - 1]); + s = strdup_printf("%s [%c]", msg, choices[dflt - 1]); statusline_addhlstr(s); free(s); } else @@ -588,7 +588,7 @@ ui_find(int next) void ui_print_number_of_items() { - char *str = mkstr(" " "|%3d/%3d", selected_items(), items); + char *str = strdup_printf(" " "|%3d/%3d", selected_items(), items); mvaddstr(0, COLS-strlen(str), str); @@ -601,7 +601,7 @@ ui_read_database() char *msg; if(items > 0) { - msg = mkstr(_("Your current data will be lost - " + msg = strdup_printf(_("Your current data will be lost - " "Press '%c' to continue"), *(S_("keybinding for yes|y"))); if(!statusline_ask_boolean(msg, FALSE)) {