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>2012-01-11 16:33:51 +0400
committerCampbell Barton <ideasman42@gmail.com>2012-01-11 16:33:51 +0400
commite10fd04db0bdcdbc326fce6cddc8af1179a5de5c (patch)
treea8f3a08b35101e30a0e5d4d1a94e0b2ef50c7122 /source/blender/blenloader
parentdcef7346eb3f16c27b3f952b6452396e66f5e996 (diff)
use BLI_strncpy and BLI_snprintf when the size of the string is known.
fix for sequencer unique naming which was missed with string length update.
Diffstat (limited to 'source/blender/blenloader')
-rw-r--r--source/blender/blenloader/intern/readfile.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c
index 1f45be6848d..82b934d52e6 100644
--- a/source/blender/blenloader/intern/readfile.c
+++ b/source/blender/blenloader/intern/readfile.c
@@ -6560,14 +6560,14 @@ static void customdata_version_242(Mesh *me)
if (layer->type == CD_MTFACE) {
if (layer->name[0] == 0) {
if (mtfacen == 0) strcpy(layer->name, "UVMap");
- else sprintf(layer->name, "UVMap.%.3d", mtfacen);
+ else BLI_snprintf(layer->name, sizeof(layer->name), "UVMap.%.3d", mtfacen);
}
mtfacen++;
}
else if (layer->type == CD_MCOL) {
if (layer->name[0] == 0) {
if (mcoln == 0) strcpy(layer->name, "Col");
- else sprintf(layer->name, "Col.%.3d", mcoln);
+ else BLI_snprintf(layer->name, sizeof(layer->name), "Col.%.3d", mcoln);
}
mcoln++;
}
@@ -9062,8 +9062,9 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
strcpy(kb->name, "Basis");
}
else {
- if(kb->name[0]==0)
- sprintf(kb->name, "Key %d", index);
+ if (kb->name[0]==0) {
+ BLI_snprintf(kb->name, sizeof(kb->name), "Key %d", index);
+ }
kb->adrcode= index++;
}
}
@@ -10056,7 +10057,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
BLI_addtail(&ob->particlesystem, psys);
md= modifier_new(eModifierType_ParticleSystem);
- sprintf(md->name, "ParticleSystem %i", BLI_countlist(&ob->particlesystem));
+ BLI_snprintf(md->name, sizeof(md->name), "ParticleSystem %i", BLI_countlist(&ob->particlesystem));
psmd= (ParticleSystemModifierData*) md;
psmd->psys=psys;
BLI_addtail(&ob->modifiers, md);