diff options
author | Campbell Barton <ideasman42@gmail.com> | 2011-02-12 19:54:24 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2011-02-12 19:54:24 +0300 |
commit | 55f68c36574779ae2fac3652466584628b22c633 (patch) | |
tree | e2f55301dda8897bf17f8b8459229d8fa5a67816 /source/blender/blenkernel/intern/blender.c | |
parent | 9eee1f962d49f14d92c8da4e677e4ee140f4f440 (diff) |
fix for more warnings.
- modifier code was using sizeof() without knowing the sizeof the array when clearing the modifier type array.
- use BLI_snprintf rather then sprintf where the size of the string is known.
- particle drawing code kept a reference to stack float values (not a problem at the moment but would crash if accessed later).
Diffstat (limited to 'source/blender/blenkernel/intern/blender.c')
-rw-r--r-- | source/blender/blenkernel/intern/blender.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/source/blender/blenkernel/intern/blender.c b/source/blender/blenkernel/intern/blender.c index 6e08df0f465..222d416e2f0 100644 --- a/source/blender/blenkernel/intern/blender.c +++ b/source/blender/blenkernel/intern/blender.c @@ -124,9 +124,9 @@ void initglobals(void) ENDIAN_ORDER= (((char*)&ENDIAN_ORDER)[0])? L_ENDIAN: B_ENDIAN; if(BLENDER_SUBVERSION) - sprintf(versionstr, "www.blender.org %d.%d", BLENDER_VERSION, BLENDER_SUBVERSION); + BLI_snprintf(versionstr, sizeof(versionstr), "www.blender.org %d.%d", BLENDER_VERSION, BLENDER_SUBVERSION); else - sprintf(versionstr, "www.blender.org %d", BLENDER_VERSION); + BLI_snprintf(versionstr, sizeof(versionstr), "www.blender.org %d", BLENDER_VERSION); #ifdef _WIN32 // FULLSCREEN G.windowstate = G_WINDOWSTATE_USERDEF; @@ -314,7 +314,7 @@ static int handle_subversion_warning(Main *main) char str[128]; - sprintf(str, "File written by newer Blender binary: %d.%d , expect loss of data!", main->minversionfile, main->minsubversionfile); + BLI_snprintf(str, sizeof(str), "File written by newer Blender binary: %d.%d , expect loss of data!", main->minversionfile, main->minsubversionfile); // XXX error(str); } return 1; @@ -520,7 +520,7 @@ void BKE_write_undo(bContext *C, const char *name) counter++; counter= counter % U.undosteps; - sprintf(numstr, "%d.blend", counter); + BLI_snprintf(numstr, sizeof(numstr), "%d.blend", counter); BLI_make_file_string("/", tstr, btempdir, numstr); success= BLO_write_file(CTX_data_main(C), tstr, G.fileflags, NULL, NULL); |