]> git.ipfire.org Git - thirdparty/zlib-ng.git/commitdiff
Removed legacy typedef caddr_t from gz_compress_mmap.
authorNathan Moinvaziri <nathan@nathanm.com>
Fri, 10 Jul 2020 20:59:25 +0000 (13:59 -0700)
committerHans Kristian Rosbach <hk-github@circlestorm.org>
Sun, 12 Jul 2020 10:30:07 +0000 (12:30 +0200)
test/fuzz/minigzip_fuzzer.c
test/minigzip.c

index e2ac6f7b17df890efcae120d1c6784d2299378bb..a4bd112d3da6fcbd2592c432678dd4346ac1ade2 100644 (file)
@@ -121,7 +121,7 @@ int gz_compress_mmap(FILE *in, gzFile out) {
     int len;
     int err;
     int ifd = fileno(in);
-    caddr_t buf;    /* mmap'ed buffer for the entire input file */
+    char *buf;      /* mmap'ed buffer for the entire input file */
     off_t buf_len;  /* length of the input file */
     struct stat sb;
 
@@ -131,8 +131,8 @@ int gz_compress_mmap(FILE *in, gzFile out) {
     if (buf_len <= 0) return Z_ERRNO;
 
     /* Now do the actual mmap: */
-    buf = mmap((caddr_t) 0, buf_len, PROT_READ, MAP_SHARED, ifd, (off_t)0);
-    if (buf == (caddr_t)(-1)) return Z_ERRNO;
+    buf = mmap((void *)0, buf_len, PROT_READ, MAP_SHARED, ifd, (off_t)0);
+    if (buf == (char *)(-1)) return Z_ERRNO;
 
     /* Compress the whole file at once: */
     len = PREFIX(gzwrite)(out, (char *)buf, (unsigned)buf_len);
index a09fcdcc24849e4e5e550ae55bb853ce261275e7..da45d48cc3fcf9132ba8e6cd4c3f25bc580468b7 100644 (file)
@@ -134,7 +134,7 @@ int gz_compress_mmap(FILE *in, gzFile out) {
     if (buf_len <= 0) return Z_ERRNO;
 
     /* Now do the actual mmap: */
-    buf = mmap((char *) 0, buf_len, PROT_READ, MAP_SHARED, ifd, (off_t)0);
+    buf = mmap((void *)0, buf_len, PROT_READ, MAP_SHARED, ifd, (off_t)0);
     if (buf == (char *)(-1)) return Z_ERRNO;
 
     /* Compress the whole file at once: */