diff options
author | Campbell Barton <ideasman42@gmail.com> | 2011-02-13 06:21:27 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2011-02-13 06:21:27 +0300 |
commit | 867fc4b463ef39ea16103f18f332c3d259624d29 (patch) | |
tree | 7d20c416241afb7b878b767a9955e284d3cddbe2 /source/creator | |
parent | 9e03a0d4762b4734fe7ccb20e03b4a3c8f939620 (diff) |
enforce string limits (reported by pedantic checking tools & some developers).
mostly replace strcpy with BLI_strncpy and multiple strcat's with a BLI_snprintf().
also fix possible crash if CWD isnt available.
Diffstat (limited to 'source/creator')
-rw-r--r-- | source/creator/creator.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/source/creator/creator.c b/source/creator/creator.c index 215dd356b7b..031f1b5cbcd 100644 --- a/source/creator/creator.c +++ b/source/creator/creator.c @@ -138,8 +138,8 @@ static int print_version(int argc, char **argv, void *data); extern int pluginapi_force_ref(void); /* from blenpluginapi:pluginapi.c */ -char bprogname[FILE_MAXDIR+FILE_MAXFILE]; /* from blenpluginapi:pluginapi.c */ -char btempdir[FILE_MAXDIR+FILE_MAXFILE]; +char bprogname[FILE_MAX]; /* from blenpluginapi:pluginapi.c */ +char btempdir[FILE_MAX]; #define BLEND_VERSION_STRING_FMT "Blender %d.%02d (sub %d) Build\n", BLENDER_VERSION/100, BLENDER_VERSION%100, BLENDER_SUBVERSION @@ -1145,7 +1145,7 @@ int main(int argc, char **argv) // copy path to executable in bprogname. playanim and creting runtimes // need this. - BLI_where_am_i(bprogname, argv[0]); + BLI_where_am_i(bprogname, sizeof(bprogname), argv[0]); #ifdef BUILD_DATE strip_quotes(build_date); @@ -1212,7 +1212,7 @@ int main(int argc, char **argv) WM_init(C, argc, argv); /* this is properly initialized with user defs, but this is default */ - BLI_where_is_temp( btempdir, 1 ); /* call after loading the startup.blend so we can read U.tempdir */ + BLI_where_is_temp(btempdir, FILE_MAX, 1); /* call after loading the startup.blend so we can read U.tempdir */ #ifndef DISABLE_SDL BLI_setenv("SDL_VIDEODRIVER", "dummy"); @@ -1223,7 +1223,7 @@ int main(int argc, char **argv) WM_init(C, argc, argv); - BLI_where_is_temp( btempdir, 0 ); /* call after loading the startup.blend so we can read U.tempdir */ + BLI_where_is_temp(btempdir, FILE_MAX, 0); /* call after loading the startup.blend so we can read U.tempdir */ } #ifdef WITH_PYTHON /** |