- off by 1 error with console command line memory re-allocation.

- documenting vgroups crashed.
This commit is contained in:
Campbell Barton 2009-09-09 23:11:43 +00:00
parent 434af76286
commit aec894939f
2 changed files with 3 additions and 3 deletions

@ -1230,13 +1230,13 @@ static int set_active_group_exec(bContext *C, wmOperator *op)
static EnumPropertyItem *vgroup_itemf(bContext *C, PointerRNA *ptr, int *free)
{
Object *ob= CTX_data_pointer_get_type(C, "object", &RNA_Object).data;
Object *ob;
EnumPropertyItem tmp = {0, "", 0, "", ""};
EnumPropertyItem *item= NULL;
bDeformGroup *def;
int a, totitem= 0;
if(!C) /* needed for docs */
if(!C || !(ob = CTX_data_pointer_get_type(C, "object", &RNA_Object).data)) /* needed for docs */
return vgroup_items;
for(a=0, def=ob->defbase.first; def; def=def->next, a++) {

@ -190,7 +190,7 @@ ConsoleLine *console_history_verify(const bContext *C)
static void console_line_verify_length(ConsoleLine *ci, int len)
{
/* resize the buffer if needed */
if(len > ci->len_alloc) {
if(len >= ci->len_alloc) {
int new_len= len * 2; /* new length */
char *new_line= MEM_callocN(new_len, "console line");
memcpy(new_line, ci->line, ci->len);