diff options
author | Dan Winship <danw@src.gnome.org> | 2002-03-09 06:03:21 +0800 |
---|---|---|
committer | Dan Winship <danw@src.gnome.org> | 2002-03-09 06:03:21 +0800 |
commit | e6cd7bec0e6f009c771999e6840ce55ca3b22c42 (patch) | |
tree | 0d5532f4ab3f5efbe4f4ad41fbf511433d9e328c /mail/mail-config-druid.c | |
parent | 9c939e7a9964b860fcfa5bdc0ca13aeaa2d74f36 (diff) | |
download | gsoc2013-evolution-e6cd7bec0e6f009c771999e6840ce55ca3b22c42.tar.gz gsoc2013-evolution-e6cd7bec0e6f009c771999e6840ce55ca3b22c42.tar.zst gsoc2013-evolution-e6cd7bec0e6f009c771999e6840ce55ca3b22c42.zip |
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
Diffstat (limited to 'mail/mail-config-druid.c')
-rw-r--r-- | mail/mail-config-druid.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/mail/mail-config-druid.c b/mail/mail-config-druid.c index e43f0dfbf5..d1c0fabcc1 100644 --- a/mail/mail-config-druid.c +++ b/mail/mail-config-druid.c @@ -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); } |