Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2011-10-09 10:03:38 +0400
committerCampbell Barton <ideasman42@gmail.com>2011-10-09 10:03:38 +0400
commit8714fb7019e853703ce8b102edac43d84b7bbe14 (patch)
treeef8993afe8cfdecf21ddead6b4c1c4152bc084f5
parent6778f7ae056bcf529820ea3fc8238dda0473eb33 (diff)
replace sprintf with strcpy where no formatting is done and return value isn't used.
-rw-r--r--source/blender/blenkernel/intern/gpencil.c2
-rw-r--r--source/blender/blenkernel/intern/library.c4
-rw-r--r--source/blender/blenkernel/intern/nla.c8
-rw-r--r--source/blender/blenlib/intern/winstuff.c2
-rw-r--r--source/blender/editors/animation/anim_draw.c4
-rw-r--r--source/blender/editors/animation/anim_ipo_utils.c4
-rw-r--r--source/blender/editors/util/ed_util.c2
-rw-r--r--source/blender/makesrna/intern/rna_fluidsim.c4
-rw-r--r--source/blender/makesrna/intern/rna_modifier.c2
9 files changed, 16 insertions, 16 deletions
diff --git a/source/blender/blenkernel/intern/gpencil.c b/source/blender/blenkernel/intern/gpencil.c
index c2e94cc97db..d56c9a63a91 100644
--- a/source/blender/blenkernel/intern/gpencil.c
+++ b/source/blender/blenkernel/intern/gpencil.c
@@ -182,7 +182,7 @@ bGPDlayer *gpencil_layer_addnew (bGPdata *gpd)
gpl->thickness = 3;
/* auto-name */
- sprintf(gpl->info, "GP_Layer");
+ strcpy(gpl->info, "GP_Layer");
BLI_uniquename(&gpd->layers, gpl, "GP_Layer", '.', offsetof(bGPDlayer, info[0]), sizeof(gpl->info));
/* make this one the active one */
diff --git a/source/blender/blenkernel/intern/library.c b/source/blender/blenkernel/intern/library.c
index 677a2922666..1dc53811fc0 100644
--- a/source/blender/blenkernel/intern/library.c
+++ b/source/blender/blenkernel/intern/library.c
@@ -941,9 +941,9 @@ static void get_flags_for_id(ID *id, char *buf)
isnode= ((Tex *)id)->use_nodes;
if (id->us<0)
- sprintf(buf, "-1W ");
+ strcpy(buf, "-1W ");
else if (!id->lib && !isfake && id->us && !isnode)
- sprintf(buf, " ");
+ strcpy(buf, " ");
else if(isnode)
sprintf(buf, "%c%cN%c ", id->lib?'L':' ', isfake?'F':' ', (id->us==0)?'O':' ');
else
diff --git a/source/blender/blenkernel/intern/nla.c b/source/blender/blenkernel/intern/nla.c
index 6ce80342dd6..9c5cf9f05fa 100644
--- a/source/blender/blenkernel/intern/nla.c
+++ b/source/blender/blenkernel/intern/nla.c
@@ -1284,16 +1284,16 @@ void BKE_nlastrip_validate_name (AnimData *adt, NlaStrip *strip)
if (strip->name[0]==0) {
switch (strip->type) {
case NLASTRIP_TYPE_CLIP: /* act-clip */
- sprintf(strip->name, "%s", (strip->act)?(strip->act->id.name+2):("<No Action>"));
+ BLI_strncpy(strip->name, (strip->act)?(strip->act->id.name+2):("<No Action>"), sizeof(strip->name));
break;
case NLASTRIP_TYPE_TRANSITION: /* transition */
- sprintf(strip->name, "Transition");
+ BLI_strncpy(strip->name, "Transition", sizeof(strip->name));
break;
case NLASTRIP_TYPE_META: /* meta */
- sprintf(strip->name, "Meta");
+ BLI_strncpy(strip->name, "Meta", sizeof(strip->name));
break;
default:
- sprintf(strip->name, "NLA Strip");
+ BLI_strncpy(strip->name, "NLA Strip", sizeof(strip->name));
break;
}
}
diff --git a/source/blender/blenlib/intern/winstuff.c b/source/blender/blenlib/intern/winstuff.c
index bf816a91fb3..3b14abb0bee 100644
--- a/source/blender/blenlib/intern/winstuff.c
+++ b/source/blender/blenlib/intern/winstuff.c
@@ -109,7 +109,7 @@ void RegisterBlendExtension(void) {
lresult = RegCreateKeyEx(root, "blendfile", 0,
NULL, REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, NULL, &hkey, &dwd);
if (lresult == ERROR_SUCCESS) {
- sprintf(buffer,"%s","Blender File");
+ strcpy(buffer,"Blender File");
lresult = RegSetValueEx(hkey, NULL, 0, REG_SZ, (BYTE*)buffer, strlen(buffer) + 1);
RegCloseKey(hkey);
}
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, "<invalid>");
+ strcpy(name, "<invalid>");
else if (fcu->rna_path == NULL)
- sprintf(name, "<no path>");
+ strcpy(name, "<no path>");
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);
diff --git a/source/blender/makesrna/intern/rna_fluidsim.c b/source/blender/makesrna/intern/rna_fluidsim.c
index 82911ebb3be..ba90aca47a3 100644
--- a/source/blender/makesrna/intern/rna_fluidsim.c
+++ b/source/blender/makesrna/intern/rna_fluidsim.c
@@ -141,12 +141,12 @@ static void rna_FluidSettings_update_type(Main *bmain, Scene *scene, PointerRNA
psys->part= part;
psys->pointcache= BKE_ptcache_add(&psys->ptcaches);
psys->flag |= PSYS_ENABLED;
- sprintf(psys->name, "FluidParticles");
+ BLI_strncpy(psys->name, "FluidParticles", sizeof(psys->name));
BLI_addtail(&ob->particlesystem,psys);
/* add modifier */
psmd= (ParticleSystemModifierData*)modifier_new(eModifierType_ParticleSystem);
- sprintf(psmd->modifier.name, "FluidParticleSystem" );
+ BLI_strncpy(psmd->modifier.name, "FluidParticleSystem", sizeof(psmd->modifier.name));
psmd->psys= psys;
BLI_addtail(&ob->modifiers, psmd);
modifier_unique_name(&ob->modifiers, (ModifierData *)psmd);
diff --git a/source/blender/makesrna/intern/rna_modifier.c b/source/blender/makesrna/intern/rna_modifier.c
index 5259ee1f6d1..f7d1b5d20cf 100644
--- a/source/blender/makesrna/intern/rna_modifier.c
+++ b/source/blender/makesrna/intern/rna_modifier.c
@@ -275,7 +275,7 @@ static void rna_Smoke_set_type(Main *bmain, Scene *scene, PointerRNA *ptr)
part->end = 250.0f;
part->ren_as = PART_DRAW_NOT;
part->draw_as = PART_DRAW_DOT;
- sprintf(psys->name, "SmokeParticles");
+ BLI_strncpy(psys->name, "SmokeParticles", sizeof(psys->name));
psys->recalc |= (PSYS_RECALC_RESET|PSYS_RECALC_PHYS);
DAG_id_tag_update(ptr->id.data, OB_RECALC_DATA);
}