[Monetdb-developers] [Monetdb-checkins] MonetDB/src/testing difflib.c, , 1.46, 1.47

Stefan Manegold Stefan.Manegold at cwi.nl
Mon Sep 10 13:18:40 CEST 2007


On Mon, Sep 10, 2007 at 09:50:19AM +0200, Fabian Groffen wrote:
> On 09-09-2007 11:36:26 +0000, Stefan Manegold wrote:
> > Update of /cvsroot/monetdb/MonetDB/src/testing
> > In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv4669
> > 
> > Modified Files:
> > 	difflib.c 
> > Log Message:
> > 
> > no need to call "touch" via "system()" to create an empty file;
> > "fclose(fopen())" should do the job within pure C.
> 
> Because you use the stream versions here, fclose(fopen()) can crash you
> tool if fopen() returns NULL, as fclose doesn't grok it.
> 
> > Index: difflib.c
> > ===================================================================
> > RCS file: /cvsroot/monetdb/MonetDB/src/testing/difflib.c,v
> > retrieving revision 1.46
> > retrieving revision 1.47
> > diff -u -d -r1.46 -r1.47
> > --- difflib.c	5 Sep 2007 17:05:58 -0000	1.46
> > +++ difflib.c	9 Sep 2007 11:36:22 -0000	1.47
> > @@ -922,7 +922,7 @@
> >  
> >  	if (!u_diff2lwc_diff(mindiff, LWC, u_diff_fn, lwc_diff_fn))
> >  		/* { UNLINK(lwc_diff_fn); ERRHNDL(0,"u_diff2lwc_diff returns 0 in u_diff2html","",1); } */
> > -		SYSTEM(strconcat("touch ", lwc_diff_fn));
> > +		fclose(Wfopen(lwc_diff_fn));
> 
> Unless Wfopen does something fancy with the pointer, I suggest to check
> if it's non NULL.

Wfopen does a had exit if fopen fails.

But thanks for watching out, anyway.

Stefan

> 
> -------------------------------------------------------------------------
> This SF.net email is sponsored by: Microsoft
> Defy all challenges. Microsoft(R) Visual Studio 2005.
> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
> _______________________________________________
> Monetdb-developers mailing list
> Monetdb-developers at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/monetdb-developers
> 
> 

-- 
| Dr. Stefan Manegold | mailto:Stefan.Manegold at cwi.nl |
| CWI,  P.O.Box 94079 | http://www.cwi.nl/~manegold/  |
| 1090 GB Amsterdam   | Tel.: +31 (20) 592-4212       |
| The Netherlands     | Fax : +31 (20) 592-4312       |




More information about the developers-list mailing list