Update of /cvsroot/monetdb/pathfinder/src/sqlhelpers/xmlshred
In directory 
sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv20437/src/sqlhelpers/xmlshred

Modified Files:
        encoding.c main.c 
Log Message:
propagated changes of Thursday Feb 21 2008 - Friday Feb 22 2008
from the XQuery_0-22 branch to the development trunk


Index: encoding.c
===================================================================
RCS file: /cvsroot/monetdb/pathfinder/src/sqlhelpers/xmlshred/encoding.c,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -d -r1.20 -r1.21
--- encoding.c  11 Jan 2008 10:47:23 -0000      1.20
+++ encoding.c  22 Feb 2008 12:46:37 -0000      1.21
@@ -690,7 +690,7 @@
 
     if (bufpos < 0 || (unsigned int) bufpos < text_size) {
         snprintf ((char *) buf + bufpos,
-                  MIN (n, BUF_SIZE - bufpos) + 1,
+                  MIN (n, BUF_SIZE - bufpos),
                   "%s",
                   (char *) chars);
         bufpos += MIN (n, BUF_SIZE - bufpos);
@@ -709,7 +709,7 @@
     (void) ctx;
 
     va_start (az, msg);
-    vsnprintf (buf, buf_size, msg, az);
+    vsnprintf (buf, buf_size - 1, msg, az);
     fprintf (err, "%s", buf);
     va_end (az);
 

Index: main.c
===================================================================
RCS file: /cvsroot/monetdb/pathfinder/src/sqlhelpers/xmlshred/main.c,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -d -r1.12 -r1.13
--- main.c      11 Jan 2008 14:43:27 -0000      1.12
+++ main.c      22 Feb 2008 12:46:37 -0000      1.13
@@ -102,7 +102,7 @@
                                             sizeof (struct option) - 1,
                                         sizeof (struct option),
                                         cmp_opt)))
-        return snprintf (buf, sizeof (opt_buf), t, l->name), buf;
+        return snprintf (buf, sizeof (opt_buf) - 1, t, l->name), buf;
     else
         return "";
 }
@@ -287,7 +287,7 @@
         if (status.attributes_separate) {
             /* attribute file */
             char attoutfile[FILENAME_MAX];
-            snprintf (attoutfile, FILENAME_MAX, "%s_atts.csv", status.outfile);
+            snprintf (attoutfile, FILENAME_MAX-1, "%s_atts.csv", 
status.outfile);
             attout = SHopen_write (attoutfile);
         }
     
@@ -295,22 +295,22 @@
             /* names file */
             char namesoutfile[FILENAME_MAX];
             char urisoutfile[FILENAME_MAX];
-            snprintf (namesoutfile, FILENAME_MAX, "%s_names.csv", 
status.outfile);
+            snprintf (namesoutfile, FILENAME_MAX-1, "%s_names.csv", 
status.outfile);
             namesout = SHopen_write (namesoutfile);
-            snprintf (urisoutfile, FILENAME_MAX, "%s_uris.csv", 
status.outfile);
+            snprintf (urisoutfile, FILENAME_MAX-1, "%s_uris.csv", 
status.outfile);
             urisout = SHopen_write (urisoutfile);
         }
     
         if (status.statistics) {
             /* guide file */
             char guideoutfile[FILENAME_MAX];
-            snprintf (guideoutfile, FILENAME_MAX, "%s_guide.xml", 
status.outfile);
+            snprintf (guideoutfile, FILENAME_MAX-1, "%s_guide.xml", 
status.outfile);
             guideout = SHopen_write (guideoutfile);
         }
 
         /* encoding file */
         char outfile[FILENAME_MAX];
-        snprintf (outfile, FILENAME_MAX, "%s.csv", status.outfile);
+        snprintf (outfile, FILENAME_MAX-1, "%s.csv", status.outfile);
         shout = SHopen_write (outfile);
     }
     else


-------------------------------------------------------------------------
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