Fixed a bug which I invented: hexBinary's string values were not
* xmlschemastypes.c: Fixed a bug which I invented: hexBinary's string
values were not duplicated corrently when creating a computed value
in xmlSchemaValAtomicType.
diff --git a/ChangeLog b/ChangeLog
index 9083fbb..6970d6c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+Thu Jun 9 15:11:38 CEST 2005 Kasimier Buchcik <libxml2-cvs@cazic.net>
+
+ * xmlschemastypes.c: Fixed a bug which I invented: hexBinary's string
+ values were not duplicated corrently when creating a computed value
+ in xmlSchemaValAtomicType.
+
Thu Jun 9 13:20:57 CEST 2005 Kasimier Buchcik <libxml2-cvs@cazic.net>
* xmlschemas.c result/schemas/include1_0_0.err:
diff --git a/xmlschemastypes.c b/xmlschemastypes.c
index 8b13f29..7f14168 100644
--- a/xmlschemastypes.c
+++ b/xmlschemastypes.c
@@ -2742,7 +2742,7 @@
goto return0;
}
case XML_SCHEMAS_HEXBINARY:{
- const xmlChar *cur = value;
+ const xmlChar *cur = value, *start;
xmlChar *base;
int total, i = 0;
@@ -2752,6 +2752,7 @@
if (normOnTheFly)
while IS_WSP_BLANK_CH(*cur) cur++;
+ start = cur;
while (((*cur >= '0') && (*cur <= '9')) ||
((*cur >= 'A') && (*cur <= 'F')) ||
((*cur >= 'a') && (*cur <= 'f'))) {
@@ -2775,7 +2776,7 @@
* Copy only the normalized piece.
* CRITICAL TODO: Check this.
*/
- cur = xmlStrndup(cur, i);
+ cur = xmlStrndup(start, i);
if (cur == NULL) {
xmlSchemaTypeErrMemory(node, "allocating hexbin data");
xmlFree(v);