Skip to content

Commit

Permalink
Fix Mat_VarDelete
Browse files Browse the repository at this point in the history
Move mat_file_ver and tmp one level down each
  • Loading branch information
tbeu committed Dec 28, 2015
1 parent 5ff01c5 commit fa7f338
Showing 1 changed file with 15 additions and 14 deletions.
29 changes: 15 additions & 14 deletions C-Sources/ModelicaMatIO.c
Original file line number Diff line number Diff line change
Expand Up @@ -9757,28 +9757,29 @@ int
Mat_VarDelete(mat_t *mat, const char *name)
{
int err = 1;
enum mat_ft mat_file_ver = MAT_FT_DEFAULT;
char *tmp_name, *new_name;
mat_t *tmp;
char temp[7] = "XXXXXX";

if ( NULL == mat || NULL == name )
return err;

switch ( mat->version ) {
case 0x0200:
mat_file_ver = MAT_FT_MAT73;
break;
case 0x0100:
mat_file_ver = MAT_FT_MAT5;
break;
case 0x0010:
mat_file_ver = MAT_FT_MAT4;
break;
}

tmp_name = mktemp(temp);
if (tmp_name != NULL) {
enum mat_ft mat_file_ver = MAT_FT_DEFAULT;
mat_t *tmp;

switch ( mat->version ) {
case 0x0200:
mat_file_ver = MAT_FT_MAT73;
break;
case 0x0100:
mat_file_ver = MAT_FT_MAT5;
break;
case 0x0010:
mat_file_ver = MAT_FT_MAT4;
break;
}

tmp = Mat_CreateVer(tmp_name,mat->header,mat_file_ver);
if ( tmp != NULL ) {
matvar_t *matvar;
Expand Down

0 comments on commit fa7f338

Please sign in to comment.