mirror of
https://github.com/cookiengineer/audacity
synced 2025-10-19 17:11:12 +02:00
Update expat sources
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user