diff options
author | Campbell Barton <ideasman42@gmail.com> | 2013-05-08 17:00:06 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2013-05-08 17:00:06 +0400 |
commit | 9514a28e4f7c8bf64f329a7d34e725fed975b1dd (patch) | |
tree | 5eced7ed099189110355c0c6fbce675049952a9d /source/blender | |
parent | f554c264da7d0f53a2519079a2e670ecb4e8629d (diff) |
code cleanup: remove redundant check in writedata().
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/blenloader/intern/writefile.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/source/blender/blenloader/intern/writefile.c b/source/blender/blenloader/intern/writefile.c index fb51df7d144..d8bf1a5e4c4 100644 --- a/source/blender/blenloader/intern/writefile.c +++ b/source/blender/blenloader/intern/writefile.c @@ -381,8 +381,8 @@ static void writedata(WriteData *wd, int filecode, int len, const void *adr) /* if (adr==NULL) return; if (len==0) return; - len += 3; - len -= (len % 4); + /* align to 4 (writes uninitialized bytes in some cases) */ + len = (len + 3) & ~3; /* init BHead */ bh.code = filecode; @@ -392,7 +392,7 @@ static void writedata(WriteData *wd, int filecode, int len, const void *adr) /* bh.len = len; mywrite(wd, &bh, sizeof(BHead)); - if (len) mywrite(wd, adr, len); + mywrite(wd, adr, len); } /* use this to force writing of lists in same order as reading (using link_list) */ |