source/blender/blenloader/intern/readfile.c - use memmove rather then strncpy for...
authorCampbell Barton <ideasman42@gmail.com>
Sun, 19 Oct 2008 04:02:37 +0000 (04:02 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Sun, 19 Oct 2008 04:02:37 +0000 (04:02 +0000)
source/blender/blenlib/intern/fileops.c - zero length strings would check for a slash before the strings first char.
source/gameengine/GameLogic/SCA_JoystickSensor.cpp - m_istrig_prev was not initialized
source/blender/src/editmesh.c - active face pointer was not set to NULL in free_editMesh()

source/blender/blenlib/intern/fileops.c
source/blender/blenloader/intern/readfile.c
source/blender/src/editmesh.c
source/gameengine/GameLogic/SCA_JoystickSensor.cpp

index 76437720e452dc6e916f4154a30d2c681107cce0..ebd8f4be1cfebdf0a0dc6fbba0ff45c177a71f7c 100644 (file)
@@ -95,12 +95,12 @@ char *BLI_last_slash(const char *string) {
 void BLI_add_slash(char *string) {
        int len = strlen(string);
 #ifdef WIN32
-       if (string[len-1]!='\\') {
+       if (len==0 || string[len-1]!='\\') {
                string[len] = '\\';
                string[len+1] = '\0';
        }
 #else
-       if (string[len-1]!='/') {
+       if (len==0 || string[len-1]!='/') {
                string[len] = '/';
                string[len+1] = '\0';
        }
index 0193acb9f9820454fb2300868d4434f5ad495c71..c2dcc86ae41dbf90716923b6fe386b7c7dd914ab 100644 (file)
@@ -7924,7 +7924,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
                                        bMessageActuator *msgAct = (bMessageActuator *) act->data;
                                        if (strlen(msgAct->toPropName) > 2) {
                                                /* strip first 2 chars, would have only worked if these were OB anyway */
-                                               strncpy(msgAct->toPropName, msgAct->toPropName+2, sizeof(msgAct->toPropName));
+                                               memmove( msgAct->toPropName, msgAct->toPropName+2, sizeof(msgAct->toPropName)-2 );
                                        } else {
                                                msgAct->toPropName[0] = '\0';
                                        }
index e96c3f6d40f285f2e7db8bdd576b6a62d2fde70a..a573ea85ca835c0b1913fe4f17221225d00823e4 100644 (file)
@@ -633,6 +633,7 @@ void free_editMesh(EditMesh *em)
 
        if(em->retopo_paint_data) retopo_free_paint_data(em->retopo_paint_data);
        em->retopo_paint_data= NULL;
+       em->act_face = NULL;
 }
 
 /* on G.editMesh */
index d0dc875da0b8c2a5d01a927dc623bfbe47a09132..8b96840b1495beb20378709876ec0f9618a548d4 100644 (file)
@@ -74,6 +74,7 @@ std::cout << " hat flag "     << m_hatf               << std::endl;
 void SCA_JoystickSensor::Init()
 {
        m_istrig=(m_invert)?1:0;
+       m_istrig_prev=0;
        m_reset = true;
 }