diff --git a/sources/minos.c b/sources/minos.c index 73db7c41..2e4358a7 100644 --- a/sources/minos.c +++ b/sources/minos.c @@ -587,6 +587,8 @@ DBASE *GetDbase(char *filename, MLONG rwmode) d->handle = f; if ( ReadIniInfo(d) || ReadIndex(d) ) { M_free(d,"index-d"); fclose(f); return(0); } if ( ComposeTableNames(d) < 0 ) { FreeTableBase(d); fclose(f); return(0); } + // free allocation from previous str_dup + M_free(d->name, "from str_dup"); d->name = str_dup(filename); d->fullname = newname; return(d); @@ -676,6 +678,8 @@ DBASE *NewDbase(char *name,MLONG number) if ( i > 0 ) d->iblocks[i]->previousblock = d->iblocks[i-1]->position; else d->iblocks[i]->previousblock = -1; d->iblocks[i]->position = ftell(f); + // Initialise, to keep valgrind happy + d->iblocks[i]->flags = -1; /*----------change 10-feb-2003 */ /* Zero things properly. We don't want garbage in the file. diff --git a/sources/transform.c b/sources/transform.c index 392cd2a1..f97a8a35 100644 --- a/sources/transform.c +++ b/sources/transform.c @@ -163,7 +163,7 @@ int CoTransform(UBYTE *in) return(error); } in = SkipAName(in); - if ( *in == '>' || *in == '<' ) in++; + if ( *in == '>' || *in == '<' || *in == '+' || *in == '-' ) in++; ss = in; c = *ss; *ss = 0; if ( c != '(' ) { @@ -548,7 +548,7 @@ illsize: MesPrint("&Illegal value for base in encode/decode transformation") type = ISLYNDON; goto doreplace; } - else if ( StrICmp(s,(UBYTE *)"islyndon+" ) == 0 ) { + else if ( StrICmp(s,(UBYTE *)"islyndon-" ) == 0 ) { type = ISLYNDON; goto doreplace; } @@ -556,7 +556,7 @@ illsize: MesPrint("&Illegal value for base in encode/decode transformation") type = ISLYNDONR; goto doreplace; } - else if ( StrICmp(s,(UBYTE *)"islyndon-" ) == 0 ) { + else if ( StrICmp(s,(UBYTE *)"islyndon+" ) == 0 ) { type = ISLYNDONR; goto doreplace; } @@ -568,7 +568,7 @@ illsize: MesPrint("&Illegal value for base in encode/decode transformation") type = TOLYNDON; goto doreplace; } - else if ( StrICmp(s,(UBYTE *)"tolyndon+" ) == 0 ) { + else if ( StrICmp(s,(UBYTE *)"tolyndon-" ) == 0 ) { type = TOLYNDON; goto doreplace; } @@ -576,7 +576,7 @@ illsize: MesPrint("&Illegal value for base in encode/decode transformation") type = TOLYNDONR; goto doreplace; } - else if ( StrICmp(s,(UBYTE *)"tolyndon-" ) == 0 ) { + else if ( StrICmp(s,(UBYTE *)"tolyndon+" ) == 0 ) { type = TOLYNDONR; goto doreplace; }