From 441c7fb79a83b7d6f9e86cd2a3b0c8eaeec6d07c Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Wed, 6 Feb 2013 02:48:03 +0000 Subject: fix for crashes running some operators in background mode and some divide by zero errors. --- source/blender/editors/space_info/info_ops.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'source/blender/editors/space_info') diff --git a/source/blender/editors/space_info/info_ops.c b/source/blender/editors/space_info/info_ops.c index 663d136fdf2..22668a3de3a 100644 --- a/source/blender/editors/space_info/info_ops.c +++ b/source/blender/editors/space_info/info_ops.c @@ -266,10 +266,10 @@ static int unpack_item_exec(bContext *C, wmOperator *op) { Main *bmain = CTX_data_main(C); ID *id; - char idname[BKE_ST_MAXNAME]; + char idname[MAX_ID_NAME - 2]; int type = RNA_int_get(op->ptr, "id_type"); int method = RNA_enum_get(op->ptr, "method"); - + RNA_string_get(op->ptr, "id_name", idname); id = BKE_libblock_find_name(type, idname); @@ -319,7 +319,7 @@ void FILE_OT_unpack_item(wmOperatorType *ot) /* properties */ RNA_def_enum(ot->srna, "method", unpack_item_method_items, PF_USE_LOCAL, "Method", "How to unpack"); RNA_def_string(ot->srna, "id_name", "", BKE_ST_MAXNAME, "ID name", "Name of ID block to unpack"); - RNA_def_int(ot->srna, "id_type", 0, 0, INT_MAX, "ID Type", "Identifier type of ID block", 0, INT_MAX); + RNA_def_int(ot->srna, "id_type", ID_IM, 0, INT_MAX, "ID Type", "Identifier type of ID block", 0, INT_MAX); } -- cgit v1.2.3