Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!rutgers!cs.utexas.edu!uunet!mcvax!inria!axis!coms!axis!jcc From: jcc@axis.fr (Jean-Christophe Collet) Newsgroups: comp.windows.x Subject: Bug fixed in Athena TextWidget (R3) Keywords: XtTextInvalidate, bug Message-ID: <545@axis.fr> Date: 6 Jun 89 17:41:22 GMT Organization: Axis Digital, Paris Lines: 54 [ I'm quite new at X11R3, so sorry if this had previously been discussed on the net ] There is a bug in the Text Widget from Athena X Widgets. I bumped into it while trying to use a TextWidget to display some messages in a subwindow. The XtTextInvalidate() function generate a segmentation fault whenever it is called. It comes from the XtTextSource widget. Its GetLastPos field isn't initialized. This field is used in the XtTextInvalidate() function to call another function. As it's empty : it crashes. This fix worked fine here : *** lib/Xaw/StringSrc.c.old Fri Jun 2 16:20:25 1989 --- lib/Xaw/StringSrc.c Fri Jun 2 16:22:27 1989 *************** *** 162,167 **** --- 162,173 ---- ((StringSourceData *) (src->data))->length = lastPos; } + static XtTextPosition StringGetLastPos (src) + XtTextSource src; + { + return (((StringSourceData *) (src->data))->length); + } + static XtTextPosition StringScan (src, pos, sType, dir, count, include) XtTextSource src; XtTextPosition pos; *************** *** 260,265 **** --- 266,272 ---- src->Read = StringReadText; src->Replace = StringReplaceText; src->SetLastPos = StringSetLastPos; + src->GetLastPos = StringGetLastPos; src->Scan = StringScan; src->SetSelection = SetSelection; src->ConvertSelection = NULL; ------------------------------------------------------------------------------- jcc@axis.fr ! "An artificial intelligence is better than none !" ..!mcvax!inria!axis!jcc ! "Artificial intelligence matches natural stupidity !" Collet jean-christophe ! "Objets inanimes avez vous donc une ame ?" ------------------------------------------------------------------------------- Axis Digital | 135 rue d'aguesseau | 92100 Boulogne | France | Phone: +33 (1) 46 03 37 75 | -------------------------------------------------------------------------------