fixed signedness warnings.

2005-08-09  Sven Neumann  <sven@gimp.org>

	* 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.
This commit is contained in:
Sven Neumann 2005-08-09 11:36:06 +00:00 committed by Sven Neumann
parent 5481a2deb6
commit 43b9555929
3 changed files with 22 additions and 9 deletions

View File

@ -1,3 +1,10 @@
2005-08-09 Sven Neumann <sven@gimp.org>
* 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 <yosh@gimp.org>
* plug-ins/common/psd.c: Generate valid names for aux channels that

View File

@ -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);

View File

@ -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);