diff options
author | Jon Trowbridge <trow@ximian.com> | 2001-08-16 15:17:26 +0800 |
---|---|---|
committer | Jon Trowbridge <trow@src.gnome.org> | 2001-08-16 15:17:26 +0800 |
commit | 844d69f78e5f7b9ae65ed30d38f6c888e4656eb9 (patch) | |
tree | 6c1f65941fc50ec7228b5ca61c23c0b31e0c6957 | |
parent | 62f6a22f0fb9c5cd129af0119688cbdf8afc7565 (diff) | |
download | gsoc2013-evolution-844d69f78e5f7b9ae65ed30d38f6c888e4656eb9.tar.gz gsoc2013-evolution-844d69f78e5f7b9ae65ed30d38f6c888e4656eb9.tar.zst gsoc2013-evolution-844d69f78e5f7b9ae65ed30d38f6c888e4656eb9.zip |
Check that name != NULL before we start messing with it. (Fixes bug #7329)
2001-08-16 Jon Trowbridge <trow@ximian.com>
* gui/contact-editor/e-contact-quick-add.c (e_contact_quick_add):
Check that name != NULL before we start messing with it.
(Fixes bug #7329)
svn path=/trunk/; revision=12084
-rw-r--r-- | addressbook/ChangeLog | 6 | ||||
-rw-r--r-- | addressbook/gui/contact-editor/e-contact-quick-add.c | 20 |
2 files changed, 17 insertions, 9 deletions
diff --git a/addressbook/ChangeLog b/addressbook/ChangeLog index 2cb8dc355a..f782fd9b17 100644 --- a/addressbook/ChangeLog +++ b/addressbook/ChangeLog @@ -1,5 +1,11 @@ 2001-08-16 Jon Trowbridge <trow@ximian.com> + * gui/contact-editor/e-contact-quick-add.c (e_contact_quick_add): + Check that name != NULL before we start messing with it. + (Fixes bug #7329) + +2001-08-16 Jon Trowbridge <trow@ximian.com> + * gui/component/select-names/e-select-names-completion.c (match_nickname): Boost scoring on an exact nickname match. Manually addressify match. diff --git a/addressbook/gui/contact-editor/e-contact-quick-add.c b/addressbook/gui/contact-editor/e-contact-quick-add.c index a94153720f..27755d980a 100644 --- a/addressbook/gui/contact-editor/e-contact-quick-add.c +++ b/addressbook/gui/contact-editor/e-contact-quick-add.c @@ -318,7 +318,7 @@ e_contact_quick_add (const gchar *in_name, const gchar *email, { QuickAdd *qa; GtkWidget *dialog; - gchar *name; + gchar *name = NULL; gint len; /* We need to have *something* to work with. */ @@ -328,16 +328,18 @@ e_contact_quick_add (const gchar *in_name, const gchar *email, return; } - name = g_strdup (in_name); + if (in_name) { + name = g_strdup (in_name); - /* Remove extra whitespace and the quotes some mailers put around names. */ - g_strstrip (name); - len = strlen (name); - if ((name[0] == '\'' && name[len-1] == '\'') || (name[0] == '"' && name[len-1] == '"')) { - name[0] = ' '; - name[len-1] = ' '; + /* Remove extra whitespace and the quotes some mailers put around names. */ + g_strstrip (name); + len = strlen (name); + if ((name[0] == '\'' && name[len-1] == '\'') || (name[0] == '"' && name[len-1] == '"')) { + name[0] = ' '; + name[len-1] = ' '; + } + g_strstrip (name); } - g_strstrip (name); qa = quick_add_new (); qa->cb = cb; |