Rewrite this to not use stpcpy, which isn't portable.

* mail-config-druid.c (management_prepare): Rewrite this to not
	use stpcpy, which isn't portable.

svn path=/trunk/; revision=15991
This commit is contained in:
Dan Winship
2002-03-08 22:03:21 +00:00
parent 9c939e7a99
commit e6cd7bec0e
2 changed files with 11 additions and 5 deletions

View File

@ -1,3 +1,8 @@
2002-03-08 Dan Winship <danw@ximian.com>
* mail-config-druid.c (management_prepare): Rewrite this to not
use stpcpy, which isn't portable.
2002-03-08 Radek Doulik <rodo@ximian.com>
* mail-accounts.c (sig_event_client): handle name changed event

View File

@ -414,17 +414,18 @@ management_prepare (EvolutionWizard *wizard, gpointer data)
name = gtk_entry_get_text (gui->gui->email_address);
if (name && *name) {
if (mail_config_get_account_by_name (name)) {
char *template, *p;
unsigned int i = 1;
char *template;
unsigned int i = 1, len;
/* length of name + 1 char for ' ' + 1 char
for '(' + 10 chars for %d + 1 char for ')'
+ 1 char for nul */
template = alloca (strlen (name) + 14);
p = stpcpy (template, name);
len = strlen (name);
template = alloca (len + 14);
strcpy (template, name);
name = template;
do {
sprintf (p, " (%d)", i++);
sprintf (template + len, " (%d)", i++);
} while (mail_config_get_account_by_name (name) && i != 0);
}