From 867fc4b463ef39ea16103f18f332c3d259624d29 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sun, 13 Feb 2011 03:21:27 +0000 Subject: 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. --- source/creator/creator.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'source/creator/creator.c') 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 /** -- cgit v1.2.3