diff options
author | Campbell Barton <ideasman42@gmail.com> | 2011-03-05 13:37:59 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2011-03-05 13:37:59 +0300 |
commit | 2610881e9c6d15c403c3b923650569fb87258264 (patch) | |
tree | 74880bf0266dd2c3aa590a517701e282b33be46b /source/blender/editors/sculpt_paint | |
parent | c7fccc84bf59bed95bdf13207c40f7a1d1711d24 (diff) |
sculpt undo struct was using an array of char pointers rather then a char array.
Diffstat (limited to 'source/blender/editors/sculpt_paint')
-rw-r--r-- | source/blender/editors/sculpt_paint/sculpt_intern.h | 2 | ||||
-rw-r--r-- | source/blender/editors/sculpt_paint/sculpt_undo.c | 8 |
2 files changed, 4 insertions, 6 deletions
diff --git a/source/blender/editors/sculpt_paint/sculpt_intern.h b/source/blender/editors/sculpt_paint/sculpt_intern.h index 2a73d95cda4..e8073b259d4 100644 --- a/source/blender/editors/sculpt_paint/sculpt_intern.h +++ b/source/blender/editors/sculpt_paint/sculpt_intern.h @@ -104,7 +104,7 @@ typedef struct SculptUndoNode { float *layer_disp; /* shape keys */ - char *shapeName[32]; /* keep size in sync with keyblock dna */ + char shapeName[sizeof(((KeyBlock *)0))->name]; } SculptUndoNode; SculptUndoNode *sculpt_undo_push_node(SculptSession *ss, PBVHNode *node); diff --git a/source/blender/editors/sculpt_paint/sculpt_undo.c b/source/blender/editors/sculpt_paint/sculpt_undo.c index 2ddb635a284..4e62c66c425 100644 --- a/source/blender/editors/sculpt_paint/sculpt_undo.c +++ b/source/blender/editors/sculpt_paint/sculpt_undo.c @@ -100,17 +100,15 @@ static void sculpt_undo_restore(bContext *C, ListBase *lb) continue; if(unode->maxvert) { - char *shapeName= (char*)unode->shapeName; - /* regular mesh restore */ if(ss->totvert != unode->maxvert) continue; - if (ss->kb && strcmp(ss->kb->name, shapeName)) { + if (ss->kb && strcmp(ss->kb->name, unode->shapeName)) { /* shape key has been changed before calling undo operator */ Key *key= ob_get_key(ob); - KeyBlock *kb= key_get_named_keyblock(key, shapeName); + KeyBlock *kb= key_get_named_keyblock(key, unode->shapeName); if (kb) { ob->shapenr= BLI_findindex(&key->block, kb) + 1; @@ -316,7 +314,7 @@ SculptUndoNode *sculpt_undo_push_node(SculptSession *ss, PBVHNode *node) memcpy(unode->grids, grids, sizeof(int)*totgrid); /* store active shape key */ - if(ss->kb) BLI_strncpy((char*)unode->shapeName, ss->kb->name, sizeof(ss->kb->name)); + if(ss->kb) BLI_strncpy(unode->shapeName, ss->kb->name, sizeof(ss->kb->name)); else unode->shapeName[0]= '\0'; return unode; |