Hi Dietmar,

> i try to compile the espeak synthesizer.
> If i start make, it produces an error snprintf not declared.
> In which lib is this function in djgpp (#include <xxx>?

It is possible that the C library of DJGPP does not support
snprintf, but espeak only uses snprintf in one context in
only 3 places. Replace the 3 lines as explained below and
you can compile without snprintf.

./src/speak_lib.cpp line 304
old: snprintf(path_home,sizeof(path_home),"%s/espeak-data",path);
replace by new: sprintf(path_home,"%s/espeak-data",path);

./src/speak_lib.cpp line 308 and also
./src/speak.cpp line 241 (both) have
old: snprintf(path_home,sizeof(path_home),"%s/espeak-data",getenv("HOME"));
replace by new: sprintf(path_home,"%s/espeak-data",getenv("HOME"));

The version with sprintf instead of snprintf will crash if
it tries to calculate a directory name longer than 120 chars
(length of path_home). The original version with snprintf
will not crash, but will instead use a truncated name. You
can also simulate snprintf with careful choice of the % args
of sprintf, but I think this is not worth the effort here.

Eric



-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Freedos-user mailing list
Freedos-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/freedos-user

Reply via email to