[Tux4kids-tuxtype-dev] Tux4kids-tuxtype-dev Digest, Vol 16, Issue 8

David Bruce davidstuartbruce at gmail.com
Mon Mar 9 10:53:13 UTC 2009


Hello,

(btw this really belongs on the tuxmath list -
tuxmath-devel at lists.sourceforge.net)

> Hi i have checked out it again and got a defferent error msg... here the
> FNLEN in line 1004 should be FONT_NAME_LENGTH i think.. but even after
> changing that it shows undeclared 'prev_font_name'...
>
> And it will work if a line for declaring the variable
>  static char prev_font_name[FONT_NAME_LENGTH];  is inlcuded in the code..
>
> Ie by making the FNLEN to FONT_NAME_LENGTH and declaring the prev_font_name
> int he function get_font the tuxmath is working for me..
> Can some one say is there anything wrong in what i have done..?

Wow, you guys are really on top of the latest changes - this is really
new stuff in tuxmath.

The problem is that I've written the same code for tuxtype and
tuxmath, but they use a little bit different constants
(FONT_NAME_LENGTH vs FNLEN, for example), and this was some code that
I modified in tuxtype and copied back into tuxmath.  I think it is now
fixed and committed to svn.  I'm kind of amazed that it compiled OK on
my machine with that error in place.

Thanks,

David

P.S. - Actually, I replaced the 'FNLEN' with a sizeof(), which I think
is the preferred way to avoid overruns in functions like strncpy():

    strncpy(prev_font_name, Opts_FontName(), sizeof(prev_font_name));



More information about the Tux4kids-tuxtype-dev mailing list