Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!ames!elroy!cit-vax!rodan!andre From: andre@rodan.caltech.edu (Andre Burgoyne) Newsgroups: comp.windows.x Subject: Fix for a bug in xstring. Keywords: xstring Message-ID: <9357@cit-vax.Caltech.Edu> Date: 1 Feb 89 06:10:45 GMT Sender: news@cit-vax.Caltech.Edu Reply-To: andre@csvax.caltech.edu Organization: California Institute of Technology Lines: 40 I found a bug in xstring.c in contrib/clients/xstring for R3. I don't know if this fix has been posted already, so here it is. It also fixes the Imakefile to compile under R3. ---cut here--- *** O.xstring.c Wed Jul 13 16:32:09 1988 --- xstring.c Tue Jan 31 21:57:02 1989 *************** *** 51,56 for(len = 0, i = 1, cp = &argv[1]; i < argc; i++, cp++) len += strlen(*cp) + 1; string = XtMalloc(len + 1); for(i = 1, cp = &argv[1]; i < argc; i++, cp++) { (void) strcat(string, *cp); (void) strcat(string, " "); --- 51,57 ----- for(len = 0, i = 1, cp = &argv[1]; i < argc; i++, cp++) len += strlen(*cp) + 1; string = XtMalloc(len + 1); + *string = '\0'; for(i = 1, cp = &argv[1]; i < argc; i++, cp++) { (void) strcat(string, *cp); (void) strcat(string, " "); *** O.Imakefile Sat Apr 23 05:14:30 1988 --- Imakefile Tue Nov 1 06:28:30 1988 *************** *** 1,3 ! LOCAL_LIBRARIES = $(XAWLIB) $(XTOOLLIB) $(XLIB) SimpleProgramTarget(xstring) --- 1,3 ----- ! LOCAL_LIBRARIES = $(XAWLIB) $(XMULIB) $(XTOOLLIB) $(XLIB) SimpleProgramTarget(xstring) ---cut here--- Andre' "nine clubs with someone else" Burgoyne andre@csvax.caltech.edu