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

Bug#351948: bug report for libxpm-dev



* Schevon, Catherine <cschevon@neuro.columbia.edu> [060208 20:33]:
> I have been using Xpm routines to read pixmap data from a file.  The
> example given here focuses on the XpmReadFiletoPixmap, but every
> function that involved reading a pixmap file triggered the bug.
> 
> 	Pixmap *pixmap, *shape;
> [...]
> 	XpmReadFileToPixmap (display, window, xpmfile, pixmap, shape /*
> or NULL */, NULL);

pixmap and shape are return values, thus you tell it to return the
values to what those pointers point to, but you have not initialized the
pointers, which simply can (but do not have to when you overwrite
something non-interesting) go harvok.
The code has to be:
        Pixmap pixmap, shape;
        ...
        XpmReadFileToPixmap(display, window, xpmfile, &pixmap, &shape,
                        NULL)

Hochachtungsvoll,
  Bernhard R. Link




Reply to: