Re: help with gdk-pixbuf 0.10.0 and xpm loader



John Ellis writes:
|I am having a problem with the xpm file loader after upgrading to
|gdk-pixbuf 0.10.0.
|
|The colors do not seem to be parsing correctly in my program (GQview),
|eog seems to work fine with the new version of gdk-pixbuf.

My changes to the xpm loader to stop it requiring an X connection
introduced this bug - I sent a patch to Federico to fix the problem the
day 0.10 was released. Here it is:
Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/gdk-pixbuf/ChangeLog,v
retrieving revision 1.264
diff -u -p -r1.264 ChangeLog
--- ChangeLog	2001/03/02 00:14:26	1.264
+++ ChangeLog	2001/03/11 22:09:24
@@ -1,3 +1,8 @@
+2001-03-01  John Harper  <jsh eazel com>
+
+	* gdk-pixbuf/gdk-pixbuf-parse-color.c (read_hex_digits): fixed
+	stupid string terminating bug I'd introduced
+
 2001-03-01  Federico Mena Quintero  <federico ximian com>
 
 	Released version 0.10.0.
Index: gdk-pixbuf/gdk-pixbuf-parse-color.c
===================================================================
RCS file: /cvs/gnome/gdk-pixbuf/gdk-pixbuf/gdk-pixbuf-parse-color.c,v
retrieving revision 1.1
diff -u -p -r1.1 gdk-pixbuf-parse-color.c
--- gdk-pixbuf/gdk-pixbuf-parse-color.c	2001/03/01 20:16:28	1.1
+++ gdk-pixbuf/gdk-pixbuf-parse-color.c	2001/03/11 22:09:24
@@ -837,7 +837,8 @@ read_hex_digits (const char *ptr, int ch
 {
 	char buf[16];
 	g_assert (chars + 1 < sizeof (buf));
-	strncpy (buf, ptr, chars);
+	memcpy (buf, ptr, chars);
+	buf[chars] = 0;
 	return strtol (buf, 0, 16);
 }
 
	John


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