[Bf-committers] Bug fix , vertex group name too long cause bad selection in Vertex Groups Panel

bmx007 bmx007 at gmail.com
Fri Jan 27 02:07:33 CET 2006


hello, (this is my first patch, so i don't know how to proceed in submitting
patch)
here is a patch correct a bug i found. It appears when you create more than
10 groups with long name
31 char ... ( the snprintf truncate the menu separator ( %xN ) )


Index: buttons_editing.c
===================================================================
RCS file: /cvsroot/bf-blender/blender/source/blender/src/buttons_editing.c,v
retrieving revision 1.240
diff -r1.240 buttons_editing.c
3277c3277
<       char (*qsort_ptr)[32] = NULL;
---
>       char (*qsort_ptr)[sizeof(dg->name)+5] = NULL; // +5 for "%x99|"
3278a3279
>       int printed;
3293,3294c3294,3296
<                       snprintf (qsort_ptr[index - 1], sizeof
(qsort_ptr[0]),
<                                         "%s%%x%d|", dg->name, index);
---
>                       printed = snprintf (qsort_ptr[index - 1], sizeof
(dg->name), dg->name);
>                       snprintf (qsort_ptr[index - 1]+printed, +5+1,
"%%x%d|", index);
>                       // +1 to move the \0
3301c3303
<       s= menustr = MEM_callocN((32 * defCount)+30, "menustr");        //
plus 30 for when defCount==0
---
>       s= menustr = MEM_callocN((sizeof(qsort_ptr[0]) * defCount)+30,
"menustr");      // plus 30 for when defCount==0
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://projects.blender.org/pipermail/bf-committers/attachments/20060127/84daa4a7/attachment.htm


More information about the Bf-committers mailing list