Re: [evolution-patches] A NULL printf patch was committed



Hi Partha,

Thanks for your suggestion. I changed again and also removed some printf statements in other functions.
Please take a look at the attachment.

Regards,
-Simon


Parthasarathi Susarla wrote:
Hey Harry,
Thanks for the patch.

But i would suggest removing the printf() altogether. And do the
following instead:

[snip]

if (address_uri && (strncmp (address_uri, "mailto:";, 7) == 0))
[snip]
Cheers,
partha

On Tue, 2005-11-29 at 19:17 +0800, Harry Lu wrote:
-       printf("get selection, address is '%s'\n", address_uri);
-
        if (address_uri == NULL)
                return;
+
+       printf("get selection, address is '%s'\n", address_uri);
if (strncmp (address_uri, "mailto:";, 7) == 0) {
                CamelInternetAddress *cia =
camel_internet_address_new();


_______________________________________________
Evolution-patches mailing list
Evolution-patches gnome org
http://mail.gnome.org/mailman/listinfo/evolution-patches

Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution/plugins/copy-tool/ChangeLog,v
retrieving revision 1.8.8.1
diff -u -p -r1.8.8.1 ChangeLog
--- ChangeLog	29 Nov 2005 11:15:23 -0000	1.8.8.1
+++ ChangeLog	30 Nov 2005 03:13:48 -0000
@@ -1,9 +1,11 @@
-2005-11-29  Simon Zheng  <Simon Zheng Sun Com>
+2005-11-30  Simon Zheng  <Simon Zheng Sun Com>
 
 	Fix for 322733.
 
-	* copy-tool.c: (ct_selection_get): Move printf() statement after 
-	NULL checking. 
+	* copy-tool.c: (ct_selection_get): Removed printf() statement 
+	in order to avoid printing NULL point.
+	(org_gnome_copy_tool_copy_address): Removed printf() statement.
+	(ct_selection_clear_event): Removed printf() statement.
 
 2005-05-11  Not Zed  <NotZed Ximian com>
 
Index: copy-tool.c
===================================================================
RCS file: /cvs/gnome/evolution/plugins/copy-tool/copy-tool.c,v
retrieving revision 1.1.26.1
diff -u -p -r1.1.26.1 copy-tool.c
--- copy-tool.c	29 Nov 2005 11:15:23 -0000	1.1.26.1
+++ copy-tool.c	30 Nov 2005 03:13:49 -0000
@@ -35,8 +35,6 @@ org_gnome_copy_tool_copy_address(void *e
 	g_free(address_uri);
 	address_uri = g_strdup(t->uri);
 
-	printf("copying address '%s'\n", address_uri);
-
 	gtk_selection_owner_set(invisible, GDK_SELECTION_PRIMARY, gtk_get_current_event_time());
 	gtk_selection_owner_set(invisible, GDK_SELECTION_CLIPBOARD, gtk_get_current_event_time());
 }
@@ -44,12 +42,7 @@ org_gnome_copy_tool_copy_address(void *e
 static void
 ct_selection_get(GtkWidget *widget, GtkSelectionData *data, guint info, guint time_stamp, void *dummy)
 {
-	if (address_uri == NULL)
-		return;
-
-	printf("get selection, address is '%s'\n", address_uri);
-
-	if (strncmp (address_uri, "mailto:";, 7) == 0) {
+	if (address_uri && (strncmp (address_uri, "mailto:";, 7) == 0)) {
 		CamelInternetAddress *cia = camel_internet_address_new();
 		CamelURL *curl;
 		char *addr;
@@ -60,7 +53,6 @@ ct_selection_get(GtkWidget *widget, GtkS
 		/* should it perhaps use address format? */
 		addr = camel_address_encode((CamelAddress *)cia);
 		tmp = addr && addr[0] ? addr : address_uri + 7;
-		printf("get selection, setting to' %s'\n", tmp);
 
 		gtk_selection_data_set(data, data->target, 8, tmp, strlen(tmp));
 		g_free(addr);
@@ -72,8 +64,6 @@ ct_selection_get(GtkWidget *widget, GtkS
 static void
 ct_selection_clear_event(GtkWidget *widget, GdkEventSelection *event, void *dummy)
 {
-	printf("selection clear event\n");
-
 	g_free(address_uri);
 	address_uri = NULL;
 }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]