Browse Source

fixed a bug concerning load mesh from dialog

"buffer[pos] = 0" probably should be moved out of the if block, because if a user opens a dialog but press "ESC", then line 64 judgement fails. But "buffer[pos] = 0" should still be set, otherwise line 86 will not return an empty string.

Former-commit-id: 124e99ddcb7b422b6a59d54c14dabb0e8dd770c9
youxijia 10 years ago
parent
commit
69f1c5f112
1 changed files with 1 additions and 2 deletions
  1. 1 2
      include/igl/file_dialog_open.cpp

+ 1 - 2
include/igl/file_dialog_open.cpp

@@ -68,9 +68,8 @@ IGL_INLINE std::string igl::file_dialog_open()
       buffer[pos] = (char)ofn.lpstrFile[pos];
       pos++;
     }
-    buffer[pos] = 0;
   } 
-  
+  buffer[pos] = 0;
 #else
   
   // For linux use zenity