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 7643772..ebd8f4b 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 0193acb..c2dcc86 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 e96c3f6..a573ea8 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 d0dc875..8b96840 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;
 }