* Make resSetBaseDir const correct (char* -> const char*)

* Document the "fileName" parameter of makeLocaleFile in the Doxygen comment


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2639 4a71c877-e1ca-e34f-864e-861f7616d084
master
Giel van Schijndel 2007-10-27 16:12:00 +00:00
parent 1811aa0cdb
commit 613a38364e
2 changed files with 4 additions and 3 deletions

View File

@ -91,7 +91,7 @@ void resShutDown(void)
// set the base resource directory // set the base resource directory
void resSetBaseDir(char *pResDir) void resSetBaseDir(const char* pResDir)
{ {
strlcpy(aResDir, pResDir, sizeof(aResDir)); strlcpy(aResDir, pResDir, sizeof(aResDir));
} }
@ -407,6 +407,7 @@ static WZ_DECL_CONST const char* getLanguage(void)
* check if given file exists in a locale dependend subdir * check if given file exists in a locale dependend subdir
* if so, modify given fileName to hold the locale dep. file, * if so, modify given fileName to hold the locale dep. file,
* else do not change given fileName * else do not change given fileName
* \param fileName[out] must be at least MAX_PATH bytes large
*/ */
static void makeLocaleFile(char fileName[]) // given string must have MAX_PATH size static void makeLocaleFile(char fileName[]) // given string must have MAX_PATH size
{ {
@ -424,7 +425,7 @@ static void makeLocaleFile(char fileName[]) // given string must have MAX_PATH
if ( PHYSFS_exists(localeFile) ) if ( PHYSFS_exists(localeFile) )
{ {
strncpy(fileName, localeFile, sizeof(localeFile)); strlcpy(fileName, localeFile, sizeof(localeFile));
debug(LOG_WZ, "Found translated file: %s", fileName); debug(LOG_WZ, "Found translated file: %s", fileName);
} }
#endif // ENABLE_NLS #endif // ENABLE_NLS

View File

@ -91,7 +91,7 @@ extern BOOL resInitialise(void);
extern void resShutDown(void); extern void resShutDown(void);
// set the base resource directory // set the base resource directory
extern void resSetBaseDir(char *pResDir); extern void resSetBaseDir(const char* pResDir);
/* Parse the res file */ /* Parse the res file */
BOOL resLoad(const char *pResFile, SDWORD blockID, BOOL resLoad(const char *pResFile, SDWORD blockID,