Thank you very much for helping me get the stupid stuff out of the way :-)

Now gdb tells me that it is exploding at the:

TitleFont[y++] = value.addr[x];

       Rev Scott Garner (aka Mr_Fab)        
Linux: Opening Doors And Shattering Windows
   http://www.llamacom.com/~mrfab/linux/

On Thu, 20 Aug 1998, Glynn Clements wrote:

> 
> Mr Fab wrote:
> 
> > if (XrmGetResource(database, "titleFont", "TitleFont", &value_type, &value)) {
> >    int x;
> > 
> >    for (x = 0; x <= strlen(value.addr); x++) {
> 
> Remember that the test in a `for' loop is evaluated on each pass of
> the loop. Try:
> 
>       int n = strlen(value.addr);
>       for (x = 0; x <= n; x++) {
> 
> or
> 
>       int n = value.size;
>       for (x = 0; x <= n; x++) {
> 
> or even
> 
>       for (x = 0; value.addr[x]; x++) {
> 
> to loop until you reach the NUL terminator.
> 
> >      int y = 0;
> 
> This will set y to zero on each pass through the loop, resulting in
> TitleFont[0] containing the last non-space character. Move the
> declaration of y outside the loop.
> 
> >      if (!isspace(value.addr[x])) {
> >          
> >          TitleFont[y++] = value.addr[x];
> > 
> >      }
> >           
> >    }
> > 
> > }
> 
> -- 
> Glynn Clements <[EMAIL PROTECTED]>
> 

Reply via email to