Commit a79313c2 authored by dcw's avatar dcw

fixed bug to do with handling of stuff after @@ when there's

no EXPORT or GLOBAL section - unitialized variable being used!
parent 2fc0bb95
......@@ -112,10 +112,11 @@ static void h_declns( base, exports, init, d ) char *base, *exports; BOOL init;
line( "#define FALSE 0\n" );
line( "#define NEW(t) ((t)malloc(sizeof(struct t)))\n\n" );
exportptr = exports;
if( *exports != '\0' )
{
line( "/* Contents of EXPORT section */" );
for( exportptr=exports; *exportptr; exportptr++ )
for( ; *exportptr; exportptr++ )
{
if( *exportptr == '@' && exportptr[1] == '@'
&& exportptr[2] == '\n' )
......@@ -170,10 +171,11 @@ static void c_declns( base, globals, begin, d ) char *base, *globals, *begin; de
line( "#include <malloc.h>" );
line( "#include \"%s.h\"\n\n", base );
globalptr=globals;
if( *globals != '\0' )
{
line( "/* Contents of GLOBAL section */" );
for( globalptr=globals; *globalptr; globalptr++ )
for( ; *globalptr; globalptr++ )
{
if( *globalptr == '@' && globalptr[1] == '@'
&& globalptr[2] == '\n' )
......
......@@ -136,12 +136,13 @@ static void defn_declns( exports, modulename, decs ) char *exports, *modulename;
nl();
nl();
exportptr=exports;
if( *exports != '\0' )
{
int i;
line( "(* Contents of EXPORT section *)" );
for( exportptr=exports; *exportptr; exportptr++ )
for( ; *exportptr; exportptr++ )
{
if( *exportptr == '@' && exportptr[1] == '@'
&& exportptr[2] == '\n' )
......@@ -283,10 +284,11 @@ static void impln_declns( globals, begin, modulename, decs ) char *globals, *beg
nl();
nl();
globalptr = globals;
if( *globals != '\0' )
{
line( "(* Contents of GLOBAL section *)" );
for( globalptr=globals; *globalptr; globalptr++ )
for( ; *globalptr; globalptr++ )
{
if( *globalptr == '@' && globalptr[1] == '@'
&& globalptr[2] == '\n' )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment