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