Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Use %zu for type size_t.
[simgrid.git] / src / simdag / dax_dtd.c
index f0eae81..ec0af0b 100644 (file)
@@ -1260,7 +1260,7 @@ char *dax_text;
  * This program was generated with the FleXML XML processor generator.
  * FleXML is Copyright (C) 1999-2005 Kristoffer Rose.  All rights reserved.
  * FleXML is Copyright (C) 2003-2011 Martin Quinson.  All rights reserved.
- * (Id: flexml.pl,v 1.67 2011/11/01 20:49:21 mquinson Exp).
+ * (Id: flexml.pl,v 1.69 2012/12/20 00:13:40 mquinson Exp).
  * 
  * There are two, intertwined parts to this program, part A and part B.
  *
@@ -1305,7 +1305,7 @@ char *dax_text;
 const char rcs_dax__flexml_skeleton[] =
  "$" "Id: skel,v 1.40 2007/10/11 09:57:24 mquinson Exp $";
 const char rcs_dax__flexml[] =
- "$" "Id: flexml.pl,v 1.67 2011/11/01 20:49:21 mquinson Exp $";
+ "$" "Id: flexml.pl,v 1.69 2012/12/20 00:13:40 mquinson Exp $";
 
 /* ANSI headers. */
 #include <stdlib.h> /* for realloc() -- needed here when using flex 2.5.4 */
@@ -1498,13 +1498,24 @@ static int ck_ilimit()
 #ifdef FLEXML_NEED_BUFFERLIT
 static void dax__bufferliteral(char c, int* pp, const char* text)
 {
-  const char *s = (c ? strchr(text,c) : text-1), *e = strrchr(text,c);
-  assert(s <= e); BUFFERSET(*pp);
-  while (++s<e) {
-    if (isspace(*s) && c) { BUFFERPUTC(' '); while (isspace(*s)) ++s; }
-    else BUFFERPUTC(*s);
-  }
-  BUFFERDONE;
+   BUFFERSET(*pp);
+   if (c) {
+      const char *s = strchr(text, c), *e = strrchr(text, c);
+      assert(s && e && s <= e);
+      ++s;
+      while (s < e) {
+        if (isspace(*s)) {
+           BUFFERPUTC(' ');
+           do ++s; while (s < e && isspace(*s));
+        } else
+          BUFFERPUTC(*s++);
+      }
+   } else {
+      const char *s = text;
+      while (*s)
+       BUFFERPUTC(*s++);
+   }
+   BUFFERDONE;
 }
 #endif