Subject: x-gw segmentation fault

From: Dennis Chandler <[email-masked]>
Date: Wed, 08 Mar 2000 10:22:50 -0800

[To be removed from this list send the message "unsubscribe fwtk-users" in the
BODY of a mail message to [email-masked].]

I've been able to build the 2.1 tookkit on RH Linux 5.2, but cannot seem
to get x-gw to run without segmentation fault.  Compilation and linking 
are without errors.  A few printf's x-gw's sws.c module reveals that
line 58 is where the trouble starts. i=(*argv[0]=='-')?0:1 seems to be
the problem.  Any advice would be apprecieated.  I've been through the
users-archive and docs extensively.  

Sidebar: When I compile fwtk on RH6.1 it all of the binaries compile OK,
but seg. fault when executed.

Here's my dev environment:
RH5.2 (out of the box)
gcc = 2.7.2.3
XFree86-3.3.2.3-25
XFree86-devel-3.3.2.3-25
XFree86-lib-3.3.2.3-25
Xaw3d-1.3-17
Xaw3d-devel-1.3-17

Here's a snippet from sws.c

 >   58         for(i=(*argv[0]=='-')?0:1;i<argc;i++) {
     59                 while(psws->key) {
     60                         if(argv[i][0]=='-' && i<=n &&
     61                          
!strncmp(&(argv[i][1]),psws->key,strlen(psws->key)) ){
     62                                 i++; pswsl->cnt++;   /* got
matched inputs */
     63                                 if( !argv[i] || argv[i][0] ==
'-') {
     64                                         z=0; i--;    /* no arg
followed by */
     65                                 } else  z=strlen(argv[i]);
     66                                 psws->arg=strsave(argv[i],z);
     67                                 goto next;
     68                         } psws++;
     69                 }
     70 unmatch:        freesws(pswsl); return NULL; /* Ooops, input not
match */
     71                 next: psws=pswsl->sws;
     72         }

Dennis Chandler
Entridia