Crasher fix.
authorMartin Poirier <theeth@yahoo.com>
Thu, 20 Nov 2008 21:45:22 +0000 (21:45 +0000)
committerMartin Poirier <theeth@yahoo.com>
Thu, 20 Nov 2008 21:45:22 +0000 (21:45 +0000)
If vertex groups had % in them, the function making the menu string would crash (in release only).

source/blender/src/buttons_editing.c

index b6dfd29d62a85b7c9c53bbe32913663f28f192f7..6b01e158e63f21dc4bca364aa96e1931c53c6edf 100644 (file)
@@ -5370,7 +5370,7 @@ char *get_vertexgroup_menustr(Object *ob)
                qsort_ptr = MEM_callocN (defCount * sizeof (qsort_ptr[0]),
                                                                 "qsort_ptr");
                for (index = 1, dg = ob->defbase.first; dg; index++, dg=dg->next) {
-                       printed = snprintf (qsort_ptr[index - 1], sizeof (dg->name), dg->name);
+                       printed = snprintf (qsort_ptr[index - 1], sizeof (dg->name), "%s", dg->name);
                        snprintf (qsort_ptr[index - 1]+printed, 6+1, "%%x%d|", index); // +1 to move the \0   see above 999 max here too
                }