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/physics/particle_edit.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source/blender/editors/physics') diff --git a/source/blender/editors/physics/particle_edit.c b/source/blender/editors/physics/particle_edit.c index 74e91cf32ea..019d6df9b73 100644 --- a/source/blender/editors/physics/particle_edit.c +++ b/source/blender/editors/physics/particle_edit.c @@ -3918,7 +3918,7 @@ void PE_undo_push(Scene *scene, const char *str) /* make new */ edit->curundo= undo= MEM_callocN(sizeof(PTCacheUndo), "particle undo file"); - strncpy(undo->name, str, 64-1); + BLI_strncpy(undo->name, str, sizeof(undo->name)); BLI_addtail(&edit->undo, undo); /* and limit amount to the maximum */ -- cgit v1.2.3