[Prev][Next][Index]
Re: Bug in SgSymbol constructor
- From: "Beata Winnicka" <bfatyga@slab.cica.indiana.edu>
- Date: Fri, 29 Jul 94 09:50:00 -0500
- To: Diego Novillo <diego@cs.ualberta.ca>
- Subject: Re: Bug in SgSymbol constructor
- Cc: Sage bug reports <sage-bugs@cica.indiana.edu>
Here is the code for fixing the bug:
in lib/newsrc/low_level.c, function newSymbol, replace:
< str = (char *) xmalloc(strlen(name) +1);
< strcpy(str,name);
by:
> if(name){
> str = (char *) xmalloc(strlen(name) +1);
> strcpy(str,name);
> }
> else str=NULL;
In lib/oldsrc/writenodes.c, function write_string, replace:
< l1 = strlen(str);
by:
> if(!str) l1 = 0;
> else l1 = strlen(str);
--Beata