From 58587a38818b0dba25886c97d584285fef4e9249 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Mon, 26 Sep 2011 18:51:10 +0000 Subject: replace strncpy with BLI_strncpy, in some cases strncpy was being misused since it doesnt ensure \0 termination. also dont call CTX_data_scene() twice when checking for function arguments. --- source/blender/editors/util/editmode_undo.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source/blender/editors/util/editmode_undo.c') diff --git a/source/blender/editors/util/editmode_undo.c b/source/blender/editors/util/editmode_undo.c index bcbc134d06d..f38ae136f71 100644 --- a/source/blender/editors/util/editmode_undo.c +++ b/source/blender/editors/util/editmode_undo.c @@ -142,7 +142,7 @@ void undo_editmode_push(bContext *C, const char *name, /* make new */ curundo= uel= MEM_callocN(sizeof(UndoElem), "undo editmode"); - strncpy(uel->name, name, MAXUNDONAME-1); + BLI_strncpy(uel->name, name, sizeof(uel->name)); BLI_addtail(&undobase, uel); uel->getdata= getdata; -- cgit v1.2.3