changeset 19192:33fed83f56c8

malloc(0) returns a null pointer. Fixes #2472.
author Daniel Atallah <daniel.atallah@gmail.com>
date Sat, 11 Aug 2007 23:41:20 +0000
parents 0ac6c0fbc102
children ceb6561c5865
files pidgin/gtkimhtml.c
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/pidgin/gtkimhtml.c	Sat Aug 11 21:26:43 2007 +0000
+++ b/pidgin/gtkimhtml.c	Sat Aug 11 23:41:20 2007 +0000
@@ -1037,7 +1037,7 @@
 {
 	char *tmp;
 
-	if (text == NULL)
+	if (text == NULL || !(*text))
 		return;
 
 	tmp = g_markup_escape_text(text, -1);
@@ -1053,7 +1053,7 @@
 	if (!gtk_text_view_get_editable(GTK_TEXT_VIEW(imhtml)))
 		return;
 
-	if (imhtml->wbfo || selection_data->length < 0) {
+	if (imhtml->wbfo || selection_data->length <= 0) {
 		gtk_clipboard_request_text(clipboard, paste_plaintext_received_cb, imhtml);
 		return;
 	} else {