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

Modified Files:
        abssynprint.c coreprint.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: coreprint.c
===================================================================
RCS file: /cvsroot/monetdb/pathfinder/compiler/debug/coreprint.c,v
retrieving revision 1.43
retrieving revision 1.44
diff -u -d -r1.43 -r1.44
--- coreprint.c 15 Feb 2008 12:37:39 -0000      1.43
+++ coreprint.c 22 Feb 2008 12:46:27 -0000      1.44
@@ -150,11 +150,11 @@
 static char     label[32];
 
 /** Print node with no content */
-#define L0(t)           snprintf (label, 32, (t))
+#define L0(t)           snprintf (label, sizeof(label)-1, (t))
 /** Print node with single content */
-#define L2(l1, l2)     snprintf (label, 32, "%s [%s]",    (l1), (l2))
+#define L2(l1, l2)     snprintf (label, sizeof(label)-1, "%s [%s]",    (l1), 
(l2))
 /** Print node with two content parts */
-#define L3(l1, l2, l3) snprintf (label, 32, "%s [%s,%s]", (l1), (l2), (l3))
+#define L3(l1, l2, l3) snprintf (label, sizeof(label)-1, "%s [%s,%s]", (l1), 
(l2), (l3))
 
 /**
  * Print core language tree in AT&T dot notation.
@@ -166,26 +166,26 @@
 core_dot (FILE *f, PFcnode_t *n, char *node)
 {
     int c;
-    char s[sizeof ("4294967285")];
+    char s[sizeof ("4294967285") + 1];
     
     switch (n->kind) {
     case c_var:       
         L2 (c_id[n->kind], PFqname_str (n->sem.var->qname));     
         break;
     case c_lit_str:   
-        snprintf (s, sizeof (s), "%s", PFesc_string (n->sem.str));
+        snprintf (s, sizeof (s) - 1, "%s", PFesc_string (n->sem.str));
         L2 (c_id[n->kind], s);
         break;
     case c_lit_int:   
-        snprintf (s, sizeof (s), LLFMT, n->sem.num);
+        snprintf (s, sizeof (s) - 1, LLFMT, n->sem.num);
         L2 (c_id[n->kind], s);                  
         break;
     case c_lit_dec:   
-        snprintf (s, sizeof (s), "%.5g", n->sem.dec);
+        snprintf (s, sizeof (s) - 1, "%.5g", n->sem.dec);
         L2 (c_id[n->kind], s);                
         break;
     case c_lit_dbl:   
-        snprintf (s, sizeof (s), "%.5g", n->sem.dbl);
+        snprintf (s, sizeof (s) - 1, "%.5g", n->sem.dbl);
         L2 (c_id[n->kind], s);                
         break;
     case c_apply:     

Index: abssynprint.c
===================================================================
RCS file: /cvsroot/monetdb/pathfinder/compiler/debug/abssynprint.c,v
retrieving revision 1.39
retrieving revision 1.40
diff -u -d -r1.39 -r1.40
--- abssynprint.c       11 Jan 2008 10:47:01 -0000      1.39
+++ abssynprint.c       22 Feb 2008 12:46:27 -0000      1.40
@@ -250,27 +250,27 @@
 static char     label[DOT_LABELS];
 
 /** Print node with no content */
-#define L(t, loc)           snprintf (label, DOT_LABELS,                    \
+#define L(t, loc)           snprintf (label, sizeof(label)-1,                  
  \
                                      "%s\\n(%u,%u-%u,%u)\\r",              \
                                       (t), (loc).first_row, (loc).first_col,\
                                            (loc).last_row, (loc).last_col)
 
 /** Print node with single content */
-#define L2(l1, l2, loc)     snprintf (label, DOT_LABELS,                    \
+#define L2(l1, l2, loc)     snprintf (label, sizeof(label)-1,                  
  \
                                      "%s [%s]\\n(%u,%u-%u,%u)\\r",         \
                                       (l1), (l2),                           \
                                       (loc).first_row, (loc).first_col,     \
                                       (loc).last_row, (loc).last_col)
 
 /** Print node with two content parts */
-#define L3(l1, l2, l3, loc) snprintf (label, DOT_LABELS,                    \
+#define L3(l1, l2, l3, loc) snprintf (label, sizeof(label)-1,                  
  \
                                       "%s [%s,%s]\\n(%u,%u-%u,%u)\\r",      \
                                       (l1), (l2), (l3),                     \
                                       (loc).first_row, (loc).first_col,     \
                                       (loc).last_row, (loc).last_col)
 
 /** Print node with two content parts */
-#define L4(l1, l2, l3, l4, loc) snprintf (label, DOT_LABELS,                \
+#define L4(l1, l2, l3, l4, loc) snprintf (label, sizeof(label)-1,              
  \
                                       "%s [%s,%s,%s]\\n(%u,%u-%u,%u)\\r",   \
                                       (l1), (l2), (l3), (l4),               \
                                       (loc).first_row, (loc).first_col,     \
@@ -286,19 +286,19 @@
 abssyn_dot (FILE *f, PFpnode_t *n, char *node, bool qnames_resolved)
 {
     int c;
-    char s[sizeof ("4294967285")];
+    char s[sizeof ("4294967285") + 1];
 
     switch (n->kind) {
         case p_lit_int:
-            snprintf (s, sizeof (s), LLFMT, n->sem.num);
+            snprintf (s, sizeof (s) - 1, LLFMT, n->sem.num);
             L2 (p_id[n->kind], s, n->loc);
             break;
         case p_lit_dec:
-            snprintf (s, sizeof (s), "%.5g", n->sem.dec);
+            snprintf (s, sizeof (s) - 1, "%.5g", n->sem.dec);
             L2 (p_id[n->kind], s, n->loc);
             break;
         case p_lit_dbl:
-            snprintf (s, sizeof (s), "%.5g", n->sem.dbl);
+            snprintf (s, sizeof (s) - 1, "%.5g", n->sem.dbl);
             L2 (p_id[n->kind], s, n->loc);
             break;
         case p_lit_str:


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