When writing the .java source file used for compiling, the fwrite() was sometimes called with a '\0' character as the last character in the stream. This trailing null generated an error from the Java compiler:
Error : -20141 Error Description : error in compiling the stored procedure :08: illegal character: \0
We now use fputs() on Unix systems which avoids this problem by stopping at a '\0' character.