From 8714fb7019e853703ce8b102edac43d84b7bbe14 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sun, 9 Oct 2011 06:03:38 +0000 Subject: replace sprintf with strcpy where no formatting is done and return value isn't used. --- source/blender/editors/animation/anim_draw.c | 4 ++-- source/blender/editors/animation/anim_ipo_utils.c | 4 ++-- source/blender/editors/util/ed_util.c | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) (limited to 'source/blender/editors') diff --git a/source/blender/editors/animation/anim_draw.c b/source/blender/editors/animation/anim_draw.c index d2b1fcc4abd..2774bd2cda4 100644 --- a/source/blender/editors/animation/anim_draw.c +++ b/source/blender/editors/animation/anim_draw.c @@ -71,12 +71,12 @@ void ANIM_timecode_string_from_frame (char *str, Scene *scene, int power, short if (timecodes) { int hours=0, minutes=0, seconds=0, frames=0; float raw_seconds= cfra; - char neg[2]= ""; + char neg[2]= {'\0'}; /* get cframes */ if (cfra < 0) { /* correction for negative cfraues */ - sprintf(neg, "-"); + neg[0]= '-'; cfra = -cfra; } if (cfra >= 3600) { diff --git a/source/blender/editors/animation/anim_ipo_utils.c b/source/blender/editors/animation/anim_ipo_utils.c index 9c43671cdf4..383e0bac796 100644 --- a/source/blender/editors/animation/anim_ipo_utils.c +++ b/source/blender/editors/animation/anim_ipo_utils.c @@ -63,9 +63,9 @@ int getname_anim_fcurve(char *name, ID *id, FCurve *fcu) return icon; else if ELEM3(NULL, id, fcu, fcu->rna_path) { if (fcu == NULL) - sprintf(name, ""); + strcpy(name, ""); else if (fcu->rna_path == NULL) - sprintf(name, ""); + strcpy(name, ""); else /* id == NULL */ BLI_snprintf(name, 256, "%s[%d]", fcu->rna_path, fcu->array_index); } diff --git a/source/blender/editors/util/ed_util.c b/source/blender/editors/util/ed_util.c index 3dd7514429e..d46f4b0ed30 100644 --- a/source/blender/editors/util/ed_util.c +++ b/source/blender/editors/util/ed_util.c @@ -171,7 +171,7 @@ void unpack_menu(bContext *C, const char *opname, const char *id_name, const cha pup= uiPupMenuBegin(C, "Unpack file", ICON_NONE); layout= uiPupMenuLayout(pup); - sprintf(line, "Remove Pack"); + strcpy(line, "Remove Pack"); props_ptr= uiItemFullO(layout, opname, line, ICON_NONE, NULL, WM_OP_EXEC_DEFAULT, UI_ITEM_O_RETURN_PROPS); RNA_enum_set(&props_ptr, "method", PF_REMOVE); RNA_string_set(&props_ptr, "id", id_name); -- cgit v1.2.3