From: Jaakko H. <jhe...@us...> - 2005-10-05 11:03:58
|
Update of /cvsroot/abook/abook In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27196 Modified Files: abook.c edit.c filter.c misc.c misc.h ui.c Log Message: Index: ui.c =================================================================== RCS file: /cvsroot/abook/abook/ui.c,v retrieving revision 1.53 retrieving revision 1.54 diff -u -d -r1.53 -r1.54 --- ui.c 3 Oct 2005 09:01:12 -0000 1.53 +++ ui.c 5 Oct 2005 11:03:36 -0000 1.54 @@ -284,7 +284,7 @@ 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 @@ 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 @@ 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)) { Index: filter.c =================================================================== RCS file: /cvsroot/abook/abook/filter.c,v retrieving revision 1.47 retrieving revision 1.48 diff -u -d -r1.47 -r1.48 --- filter.c 3 Oct 2005 10:03:54 -0000 1.47 +++ filter.c 5 Oct 2005 11:03:36 -0000 1.48 @@ -795,7 +795,7 @@ int j; get_first_email(email, e.item); - tmp = mkstr("cn=%s,mail=%s", database[e.item][NAME], email); + tmp = strdup_printf("cn=%s,mail=%s", database[e.item][NAME], email); ldif_fput_type_and_value(out, "dn", tmp); free(tmp); Index: misc.c =================================================================== RCS file: /cvsroot/abook/abook/misc.c,v retrieving revision 1.20 retrieving revision 1.21 diff -u -d -r1.20 -r1.21 --- misc.c 10 Sep 2005 07:11:11 -0000 1.20 +++ misc.c 5 Oct 2005 11:03:36 -0000 1.21 @@ -80,7 +80,7 @@ #endif char * -mkstr (const char *format, ... ) +strdup_printf (const char *format, ... ) { MY_VA_LOCAL_DECL; size_t size = 100; Index: misc.h =================================================================== RCS file: /cvsroot/abook/abook/misc.h,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- misc.h 26 Jan 2004 09:51:35 -0000 1.3 +++ misc.h 5 Oct 2005 11:03:36 -0000 1.4 @@ -6,8 +6,8 @@ char *strlower(char *str); char *strtrim(char *); -char *mkstr (const char *format, ... ); -char *strconcat (const char *str, ...); +char *strdup_printf(const char *format, ... ); +char *strconcat(const char *str, ...); int safe_strcmp(const char *s1, const char *s2); int safe_strcoll(const char *s1, const char *s2); Index: edit.c =================================================================== RCS file: /cvsroot/abook/abook/edit.c,v retrieving revision 1.41 retrieving revision 1.42 diff -u -d -r1.41 -r1.42 --- edit.c 25 Sep 2005 16:28:00 -0000 1.41 +++ edit.c 5 Oct 2005 11:03:36 -0000 1.42 @@ -383,7 +383,7 @@ if(j != n) return 0; - str = mkstr("%s: ", gettext(abook_fields[i].name)); + str = strdup_printf("%s: ", gettext(abook_fields[i].name)); change_field(str, &database[item][i]); free(str); Index: abook.c =================================================================== RCS file: /cvsroot/abook/abook/abook.c,v retrieving revision 1.56 retrieving revision 1.57 diff -u -d -r1.56 -r1.57 --- abook.c 27 Sep 2005 08:15:13 -0000 1.56 +++ abook.c 5 Oct 2005 11:03:36 -0000 1.57 @@ -135,7 +135,7 @@ umask(DEFAULT_UMASK); if(!datafile_writeable()) { - char *s = mkstr(_("File %s is not writeable"), datafile); + char *s = strdup_printf(_("File %s is not writeable"), datafile); refresh_screen(); statusline_msg(s); free(s); @@ -503,12 +503,12 @@ { char email[MAX_EMAIL_LEN]; char *ret; - char *name = mkstr("\"%s\"", database[item][NAME]); + char *name = strdup_printf("\"%s\"", database[item][NAME]); get_first_email(email, item); ret = *database[item][EMAIL] ? - mkstr("%s <%s>", name, email) : + strdup_printf("%s <%s>", name, email) : xstrdup(name); free(name); @@ -578,7 +578,7 @@ return; if( database[item][URL] ) - cmd = mkstr("%s '%s'", + cmd = strdup_printf("%s '%s'", opt_get_str(STR_WWW_COMMAND), safe_str(database[item][URL])); else |