[Expat-checkins] expat/lib xmlparse.c,1.48,1.49

kwaclaw@users.sourceforge.net kwaclaw@users.sourceforge.net
Tue Jul 9 11:30:02 2002


Update of /cvsroot/expat/expat/lib
In directory usw-pr-cvs1:/tmp/cvs-serv7988

Modified Files:
	xmlparse.c 
Log Message:
Fix for bug #579196.

Index: xmlparse.c
===================================================================
RCS file: /cvsroot/expat/expat/lib/xmlparse.c,v
retrieving revision 1.48
retrieving revision 1.49
diff -u -d -r1.48 -r1.49
--- xmlparse.c	8 Jul 2002 17:08:45 -0000	1.48
+++ xmlparse.c	9 Jul 2002 18:29:23 -0000	1.49
@@ -3553,6 +3553,8 @@
       if (dtd.in_eldecl)
 	{
 	  ELEMENT_TYPE *el;
+    const XML_Char *name;
+    int nameLen;
 	  const char *nxt = quant == XML_CQUANT_NONE ? next : next - enc->minBytesPerChar;
 	  int myindex = nextScaffoldPart(parser);
 	  if (myindex < 0)
@@ -3562,8 +3564,11 @@
 	  el = getElementType(parser, enc, s, nxt);
 	  if (! el)
 	    return XML_ERROR_NO_MEMORY;
-	  dtd.scaffold[myindex].name = el->name;
-	  dtd.contentStringLen +=  nxt - s + 1;
+    name = el->name;
+    dtd.scaffold[myindex].name = name;
+    nameLen = 0;
+    for (; name[nameLen++]; );
+    dtd.contentStringLen +=  nameLen;
 	}
       break;