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.

-------------------------------------------------------------------------
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
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-developers

Reply via email to