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>2009-02-18 08:49:51 +0300
committerCampbell Barton <ideasman42@gmail.com>2009-02-18 08:49:51 +0300
commit7d2582de09935c7050665a738eaca9097f3d0870 (patch)
tree01582b9f32d0539bdd07d2dc3b2565cb1da5f3a0 /source/blender
parent21925c6f47bebba547e30ee81a199dd761912b60 (diff)
more uninitialized variables and auto-complete could copy a string over its self.
Diffstat (limited to 'source/blender')
-rw-r--r--source/blender/blenloader/intern/writefile.c2
-rw-r--r--source/blender/src/drawobject.c10
-rw-r--r--source/blender/src/interface.c9
3 files changed, 12 insertions, 9 deletions
diff --git a/source/blender/blenloader/intern/writefile.c b/source/blender/blenloader/intern/writefile.c
index e06e7eb2d85..92d847d4782 100644
--- a/source/blender/blenloader/intern/writefile.c
+++ b/source/blender/blenloader/intern/writefile.c
@@ -2032,7 +2032,7 @@ static void write_global(WriteData *wd)
fg.subversion= BLENDER_SUBVERSION;
fg.minversion= BLENDER_MINVERSION;
fg.minsubversion= BLENDER_MINSUBVERSION;
-
+ fg.pads= 0; /* prevent mem checkers from complaining */
writestruct(wd, GLOB, "FileGlobal", 1, &fg);
}
diff --git a/source/blender/src/drawobject.c b/source/blender/src/drawobject.c
index ad9120e42e7..43991194658 100644
--- a/source/blender/src/drawobject.c
+++ b/source/blender/src/drawobject.c
@@ -1096,14 +1096,15 @@ void lattice_foreachScreenVert(void (*func)(void *userData, BPoint *bp, int x, i
float *co = dl?dl->verts:NULL;
BPoint *bp = editLatt->def;
float pmat[4][4], vmat[4][4];
- short s[2];
+ short s[2] = {IS_CLIPPED, 0};
view3d_get_object_project_mat(curarea, G.obedit, pmat, vmat);
for (i=0; i<N; i++, bp++, co+=3) {
if (bp->hide==0) {
view3d_project_short_clip(curarea, dl?co:bp->vec, s, pmat, vmat);
- func(userData, bp, s[0], s[1]);
+ if (s[0] != IS_CLIPPED)
+ func(userData, bp, s[0], s[1]);
}
}
}
@@ -1303,7 +1304,7 @@ void mesh_foreachScreenFace(void (*func)(void *userData, EditFace *efa, int x, i
void nurbs_foreachScreenVert(void (*func)(void *userData, Nurb *nu, BPoint *bp, BezTriple *bezt, int beztindex, int x, int y), void *userData)
{
float pmat[4][4], vmat[4][4];
- short s[2];
+ short s[2] = {IS_CLIPPED, 0};
Nurb *nu;
int i;
@@ -1339,7 +1340,8 @@ void nurbs_foreachScreenVert(void (*func)(void *userData, Nurb *nu, BPoint *bp,
if(bp->hide==0) {
view3d_project_short_clip(curarea, bp->vec, s, pmat, vmat);
- func(userData, nu, bp, NULL, -1, s[0], s[1]);
+ if (s[0] != IS_CLIPPED)
+ func(userData, nu, bp, NULL, -1, s[0], s[1]);
}
}
}
diff --git a/source/blender/src/interface.c b/source/blender/src/interface.c
index 7417218f253..40640c01998 100644
--- a/source/blender/src/interface.c
+++ b/source/blender/src/interface.c
@@ -6083,12 +6083,13 @@ void autocomplete_do_name(AutoComplete *autocpl, const char *name)
}
void autocomplete_end(AutoComplete *autocpl, char *autoname)
-{
+{
if(autocpl->truncate[0])
BLI_strncpy(autoname, autocpl->truncate, autocpl->maxlen);
- else
- BLI_strncpy(autoname, autocpl->startname, autocpl->maxlen);
-
+ else {
+ if (autoname != autocpl->startname) /* dont copy a string over its self */
+ BLI_strncpy(autoname, autocpl->startname, autocpl->maxlen);
+ }
MEM_freeN(autocpl->truncate);
MEM_freeN(autocpl);
}