Alessandro,
I choose this initialization, because a.) its the same as used by InternalOpen() right below and b.) it is now very obvious that ptlibPath it is now always initialized.
Your method is ok, too. If you want changes done a certain way, the easiest method would be to send in patches ("diff -u") instead of general hints. ;-)
Regards, Jan
Alessandro Angeli wrote:
From: "Jan Willamowius" jan@willamowius.de Date: Tuesday 11 January 2011 16:30
the initialization is fixed in the CVS now. Thanks!
Wouldn't an #else make more sense than the memset()? After all, initialization is already guaranteed if the envvar is set or the default is defined. This is the fix I used:
if (env != NULL) strcpy(ptlibPath, env); #ifdef P_DEFAULT_PLUGIN_DIR else strcpy(ptlibPath, P_DEFAULT_PLUGIN_DIR); #else else strcpy(ptlibPath, ""); #endif
Or, more compact:
(void)strcpy(ptlibPath,env ? env : # ifdef P_DEFAULT_PLUGIN_DIR P_DEFAULT_PLUGIN_DIR # else "" # endif );
If you could provide a patch to switch to safe string routines that would be great. So far we don't have any other volunteers.
Well, I don't even have a working build yet :-) For now I'll just keep reporting the bugs I find until I have something working.
-- Alessandro