New code to write 'sub version' string. It was using a (controlled) 1 byte

overflow in a safe area, but that's not very nice code...
This commit is contained in:
Ton Roosendaal
2007-01-08 12:31:53 +00:00
parent 1f93826144
commit dfeda474a5

View File

@@ -1842,6 +1842,7 @@ static void write_brushes(WriteData *wd, ListBase *idbase)
static void write_global(WriteData *wd)
{
FileGlobal fg;
char subvstr[8];
fg.curscreen= G.curscreen;
fg.curscene= G.scene;
@@ -1849,8 +1850,10 @@ static void write_global(WriteData *wd)
fg.winpos= G.winpos;
fg.fileflags= (G.fileflags & ~G_FILE_NO_UI); // prevent to save this, is not good convention, and feature with concerns...
fg.globalf= G.f;
/* note, this will print byte nr 5, but that's corrected */
sprintf(fg.subvstr, "%4d", BLENDER_SUBVERSION);
sprintf(subvstr, "%4d", BLENDER_SUBVERSION);
memcpy(fg.subvstr, subvstr, 4);
fg.subversion= BLENDER_SUBVERSION;
fg.minversion= BLENDER_MINVERSION;
fg.minsubversion= BLENDER_MINSUBVERSION;