summaryrefslogtreecommitdiff
path: root/testSAX.c
diff options
context:
space:
mode:
authorMike Hommey <mh@glandium.org>2004-07-06 12:57:17 +0000
committerMike Hommey <mh@glandium.org>2004-07-06 12:57:17 +0000
commitc14c53a3645d81281058d4bb4cff24fa8d6faf33 (patch)
tree29bccc2e7499af078a3d1cdcfb517a1dee891be5 /testSAX.c
parentd4e028c96af89ade493b440d4f2de6b684c03a06 (diff)
downloadlibxml2-upstream/2.6.11.tar.gz
Load /tmp/tmp.DIvcnD/libxml2-2.6.11 intoupstream/2.6.11
packages/libxml2/branches/upstream/current.
Diffstat (limited to 'testSAX.c')
-rw-r--r--testSAX.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/testSAX.c b/testSAX.c
index f394078..c18dd0a 100644
--- a/testSAX.c
+++ b/testSAX.c
@@ -918,7 +918,7 @@ startElementNsDebug(void *ctx ATTRIBUTE_UNUSED,
}
fprintf(stdout, ", %d, %d", nb_attributes, nb_defaulted);
if (attributes != NULL) {
- for (i = 0;i < nb_attributes;i += 5) {
+ for (i = 0;i < nb_attributes * 5;i += 5) {
if (attributes[i + 1] != NULL)
fprintf(stdout, ", %s:%s='", attributes[i + 1], attributes[i]);
else
@@ -1011,7 +1011,11 @@ parseAndPrintFile(char *filename) {
/*
* Empty callbacks for checking
*/
+#if defined(_WIN32) || defined (__DJGPP__) && !defined (__CYGWIN__)
+ f = fopen(filename, "rb");
+#else
f = fopen(filename, "r");
+#endif
if (f != NULL) {
int ret;
char chars[10];
@@ -1036,7 +1040,11 @@ parseAndPrintFile(char *filename) {
/*
* Debug callback
*/
+#if defined(_WIN32) || defined (__DJGPP__) && !defined (__CYGWIN__)
+ f = fopen(filename, "rb");
+#else
f = fopen(filename, "r");
+#endif
if (f != NULL) {
int ret;
char chars[10];
@@ -1118,6 +1126,8 @@ int main(int argc, char **argv) {
int i;
int files = 0;
+ LIBXML_TEST_VERSION /* be safe, plus calls xmlInitParser */
+
for (i = 1; i < argc ; i++) {
if ((!strcmp(argv[i], "-debug")) || (!strcmp(argv[i], "--debug")))
debug++;