diff options
author | Ton Roosendaal <ton@blender.org> | 2007-01-08 15:31:53 +0300 |
---|---|---|
committer | Ton Roosendaal <ton@blender.org> | 2007-01-08 15:31:53 +0300 |
commit | dfeda474a54ef2e05dfe8770479740117c1adff6 (patch) | |
tree | da0266db558a2e39a61da13168b18443050116b2 /source/blender/blenloader | |
parent | 1f9382614404ec98ec8594d4463754b34d7469cc (diff) |
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...
Diffstat (limited to 'source/blender/blenloader')
-rw-r--r-- | source/blender/blenloader/intern/writefile.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/source/blender/blenloader/intern/writefile.c b/source/blender/blenloader/intern/writefile.c index 35b088ebbfc..4b68eb052dd 100644 --- a/source/blender/blenloader/intern/writefile.c +++ b/source/blender/blenloader/intern/writefile.c @@ -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; |