1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-10-19 17:11:12 +02:00

Update expat sources

This commit is contained in:
Paul Licameli
2017-06-27 05:34:22 -04:00
parent 138c188fb4
commit 941ad55140
43 changed files with 4134 additions and 882 deletions

View File

@@ -42,6 +42,10 @@ filemap(const char *name,
fprintf(stderr, "%s: not a regular file\n", name);
return 0;
}
if (sb.st_size > XML_MAX_CHUNK_LEN) {
close(fd);
return 2; /* Cannot be passed to XML_Parse in one go */
}
nbytes = sb.st_size;
/* mmap fails for zero length files */
@@ -51,7 +55,7 @@ filemap(const char *name,
close(fd);
return 1;
}
p = (void *)mmap((caddr_t)0, (size_t)nbytes, PROT_READ,
p = (void *)mmap((void *)0, (size_t)nbytes, PROT_READ,
MAP_FILE|MAP_PRIVATE, fd, (off_t)0);
if (p == (void *)-1) {
perror(name);
@@ -59,7 +63,7 @@ filemap(const char *name,
return 0;
}
processor(p, nbytes, name, arg);
munmap((caddr_t)p, nbytes);
munmap((void *)p, nbytes);
close(fd);
return 1;
}