[iortcw] 32/95: All: Fix source filename/includepath length in l_precomp.c
Simon McVittie
smcv at debian.org
Fri Sep 8 10:41:55 UTC 2017
This is an automated email from the git hooks/post-receive script.
smcv pushed a commit to tag 1.51
in repository iortcw.
commit 055a87857cc8f1189e7231544a4976532b590832
Author: MAN-AT-ARMS <M4N4T4RMS at gmail.com>
Date: Tue Feb 21 17:38:44 2017 -0500
All: Fix source filename/includepath length in l_precomp.c
---
MP/code/botlib/l_precomp.c | 8 ++++----
SP/code/botlib/l_precomp.c | 8 ++++----
2 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/MP/code/botlib/l_precomp.c b/MP/code/botlib/l_precomp.c
index f2d756a..ea5d65e 100644
--- a/MP/code/botlib/l_precomp.c
+++ b/MP/code/botlib/l_precomp.c
@@ -1016,7 +1016,7 @@ int PC_Directive_include( source_t *source ) {
memset( &file, 0, sizeof( foundfile_t ) );
script = LoadScriptFile( path );
if ( script ) {
- strncpy( script->filename, path, _MAX_PATH );
+ Q_strncpyz( script->filename, path, sizeof( script->filename ) );
}
} //end if
#endif //QUAKE
@@ -2951,7 +2951,7 @@ void PC_UnreadToken( source_t *source, token_t *token ) {
void PC_SetIncludePath( source_t *source, char *path ) {
size_t len;
- Q_strncpyz(source->includepath, path, _MAX_PATH-1);
+ Q_strncpyz( source->includepath, path, sizeof( source->includepath ) - 1 );
len = strlen(source->includepath);
//add trailing path seperator
@@ -2992,7 +2992,7 @@ source_t *LoadSourceFile( const char *filename ) {
source = (source_t *) GetMemory( sizeof( source_t ) );
memset( source, 0, sizeof( source_t ) );
- strncpy( source->filename, filename, _MAX_PATH );
+ Q_strncpyz( source->filename, filename, sizeof( source->filename ) );
source->scriptstack = script;
source->tokens = NULL;
source->defines = NULL;
@@ -3026,7 +3026,7 @@ source_t *LoadSourceMemory( char *ptr, int length, char *name ) {
source = (source_t *) GetMemory( sizeof( source_t ) );
memset( source, 0, sizeof( source_t ) );
- strncpy( source->filename, name, _MAX_PATH );
+ Q_strncpyz( source->filename, name, sizeof( source->filename ) );
source->scriptstack = script;
source->tokens = NULL;
source->defines = NULL;
diff --git a/SP/code/botlib/l_precomp.c b/SP/code/botlib/l_precomp.c
index 8252908..0559804 100644
--- a/SP/code/botlib/l_precomp.c
+++ b/SP/code/botlib/l_precomp.c
@@ -1011,7 +1011,7 @@ int PC_Directive_include( source_t *source ) {
memset( &file, 0, sizeof( foundfile_t ) );
script = LoadScriptFile( path );
if ( script ) {
- strncpy( script->filename, path, _MAX_PATH );
+ Q_strncpyz( script->filename, path, sizeof( script->filename ) );
}
} //end if
#endif //QUAKE
@@ -2949,7 +2949,7 @@ void PC_UnreadToken( source_t *source, token_t *token ) {
void PC_SetIncludePath( source_t *source, char *path ) {
size_t len;
- Q_strncpyz(source->includepath, path, _MAX_PATH-1);
+ Q_strncpyz( source->includepath, path, sizeof( source->includepath ) - 1 );
len = strlen(source->includepath);
//add trailing path seperator
@@ -2990,7 +2990,7 @@ source_t *LoadSourceFile( const char *filename ) {
source = (source_t *) GetMemory( sizeof( source_t ) );
memset( source, 0, sizeof( source_t ) );
- strncpy( source->filename, filename, _MAX_PATH );
+ Q_strncpyz( source->filename, filename, sizeof( source->filename ) );
source->scriptstack = script;
source->tokens = NULL;
source->defines = NULL;
@@ -3024,7 +3024,7 @@ source_t *LoadSourceMemory( char *ptr, int length, char *name ) {
source = (source_t *) GetMemory( sizeof( source_t ) );
memset( source, 0, sizeof( source_t ) );
- strncpy( source->filename, name, _MAX_PATH );
+ Q_strncpyz( source->filename, name, sizeof( source->filename ) );
source->scriptstack = script;
source->tokens = NULL;
source->defines = NULL;
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-games/iortcw.git
More information about the Pkg-games-commits
mailing list