Update of /cvsroot/monetdb/pathfinder/compiler/algebra
In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv21153/compiler/algebra

Modified Files:
      Tag: XQuery_0-22
        algebra.c 
Log Message:
This is a fix for bug [ 1892554 ] PF: loading pre-compiled MIL modules
fails on Windows

There seems to a difference between Windows and Linux in the meaning
of the second argument of snprintf and vsnprintf: in Linux this
argument gives the size of the buffer to which the function writes,
whereas in Windows it gives the number of non-NULL bytes that it can
write (and then it adds a NULL).  This means that on Windows you have
to specify a size which is *smaller* than the actual size of the
buffer.

To make the same code work on both flavors, in some cases we now
overallocate the needed space by one byte so that we can use
(sizeof(buf)-1) as size.


Index: algebra.c
===================================================================
RCS file: /cvsroot/monetdb/pathfinder/compiler/algebra/algebra.c,v
retrieving revision 1.69
retrieving revision 1.69.4.1
diff -u -d -r1.69 -r1.69.4.1
--- algebra.c   28 Jan 2008 16:31:41 -0000      1.69
+++ algebra.c   22 Feb 2008 10:39:19 -0000      1.69.4.1
@@ -961,7 +961,7 @@
             if (att & (1 << 3)) {
                 unsigned int id = att >> 4;
                 size_t len = sizeof ("iter0000");
-                char *res = PFmalloc (len);
+                char *res = PFmalloc (len+1);
 
                 assert (id < 10000);
 


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Monetdb-pf-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-pf-checkins

Reply via email to