diff --git a/ChangeLog b/ChangeLog index 3c0cbeb1e3..8e91bbe2f1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2005-08-09 Sven Neumann + + * app/config/gimpxmlparser.c: fixed signedness warnings. + + * plug-ins/imagemap/imap_browse.c (handle_drop): UTF-8 validate + the dropped text before setting it on the entry. + 2005-08-08 Manish Singh * plug-ins/common/psd.c: Generate valid names for aux channels that diff --git a/app/config/gimpxmlparser.c b/app/config/gimpxmlparser.c index c2515c4267..2b2ae22abc 100644 --- a/app/config/gimpxmlparser.c +++ b/app/config/gimpxmlparser.c @@ -157,7 +157,7 @@ gimp_xml_parser_parse_io_channel (GimpXmlParser *parser, GError **error) { GIOStatus status; - guchar buffer[4096]; + gchar buffer[4096]; gsize len = 0; gsize bytes; const gchar *io_encoding; @@ -259,12 +259,17 @@ gimp_xml_parser_parse_buffer (GimpXmlParser *parser, if (g_ascii_strcasecmp (encoding, "UTF-8") && g_ascii_strcasecmp (encoding, "UTF8")) { - conv = g_convert (buffer, len, "UTF-8", encoding, NULL, &len, error); + gsize written; + + conv = g_convert (buffer, len, + "UTF-8", encoding, NULL, &written, error); if (! conv) { g_free (encoding); return FALSE; } + + len = written; } g_free (encoding); diff --git a/plug-ins/imagemap/imap_browse.c b/plug-ins/imagemap/imap_browse.c index ceece9a09f..d79c55b7fb 100644 --- a/plug-ins/imagemap/imap_browse.c +++ b/plug-ins/imagemap/imap_browse.c @@ -96,16 +96,17 @@ static void handle_drop(GtkWidget *widget, GdkDragContext *context, gint x, gint y, GtkSelectionData *data, guint info, guint time) { - gboolean success; + gboolean success = FALSE; if (data->length >= 0 && data->format == 8) { - gtk_entry_set_text(GTK_ENTRY(widget), data->data); - success = TRUE; - } - else - { - success = FALSE; + const gchar *text = (const gchar *) data->data; + + if (g_utf8_validate (text, -1, NULL)) + { + gtk_entry_set_text (GTK_ENTRY (widget), text); + success = TRUE; + } } gtk_drag_finish(context, success, FALSE, time);