CVS update: php3/functions
| From: | steffann | Date: | Tue, 09 Mar 1999 12:54:34 +0000 |
| Subject: | CVS update: php3/functions | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-4537@lists.php.net to get a copy of this message | ||
Date: Tuesday March 9, 1999 @ 7:54
Author: steffann
Update of /repository/php3/functions
In directory asf:/u/temp/cvs-serv19231/functions
Modified Files:
xml.c
Log Message:
Fixed the XML bug that caused garbage behind attributes
Index: php3/functions/xml.c
diff -c php3/functions/xml.c:1.22 php3/functions/xml.c:1.23
*** php3/functions/xml.c:1.22 Mon Feb 8 10:53:01 1999
--- php3/functions/xml.c Tue Mar 9 07:54:34 1999
***************
*** 27,33 ****
+----------------------------------------------------------------------+
*/
! /* $Id: xml.c,v 1.22 1999/02/08 15:53:01 rasmus Exp $ */
#define IS_EXT_MODULE
#if COMPILE_DL
# if PHP_31
--- 27,33 ----
+----------------------------------------------------------------------+
*/
! /* $Id: xml.c,v 1.23 1999/03/09 12:54:34 steffann Exp $ */
#define IS_EXT_MODULE
#if COMPILE_DL
# if PHP_31
***************
*** 512,518 ****
xml_utf8_decode(const XML_Char *s, int len, int *newlen, const XML_Char *encoding)
{
int pos = len;
! char *newbuf = emalloc(len);
unsigned short c;
char (*decoder)(unsigned short) = NULL;
xml_encoding *enc = xml_get_encoding(encoding);
--- 512,518 ----
xml_utf8_decode(const XML_Char *s, int len, int *newlen, const XML_Char *encoding)
{
int pos = len;
! char *newbuf = emalloc(len + 1);
unsigned short c;
char (*decoder)(unsigned short) = NULL;
xml_encoding *enc = xml_get_encoding(encoding);
***************
*** 527,532 ****
--- 527,533 ----
*/
memcpy(newbuf, s, len);
*newlen = len;
+ newbuf[*newlen] = '\0';
return newbuf;
}
while (pos > 0) {
***************
*** 551,558 ****
++*newlen;
}
if (*newlen < len) {
! newbuf = erealloc(newbuf, *newlen);
}
return newbuf;
}
/* }}} */
--- 552,560 ----
++*newlen;
}
if (*newlen < len) {
! newbuf = erealloc(newbuf, *newlen + 1);
}
+ newbuf[*newlen] = '\0';
return newbuf;
}
/* }}} */
***************
*** 618,623 ****
--- 620,626 ----
decoded_value = xml_utf8_decode(value, strlen(value),
&decoded_len,
parser->target_encoding);
+
add_assoc_string(args[2], key, decoded_value, 0);
if (parser->case_folding) {
efree(key);
--
PHP Development Mailing List http://www.php.net/
To unsubscribe send an empty message to php-dev-unsubscribe@lists.php.net
For help: php-dev-help@lists.php.net