]> granicus.if.org Git - graphviz/commitdiff
squash another -Wsign-conversion warning in core_loadimage_ps
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Sat, 15 May 2021 00:42:05 +0000 (17:42 -0700)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Thu, 27 May 2021 15:02:39 +0000 (08:02 -0700)
us->datasize and statbuf.st_size are equal at this point, so we may as well use
the correctly typed one of them.

plugin/core/gvloadimage_core.c

index 32845f7b1e75786e192df0ebcf82db8129c38fcb..eb6334ddb0d2aa1a6efbe734c15f945807fad63e 100644 (file)
@@ -181,7 +181,7 @@ static void core_loadimage_ps(GVJ_t * job, usershape_t *us, boxf b, boolean fill
                fstat(fd, &statbuf);
                us->datasize = (size_t)statbuf.st_size;
 #ifdef HAVE_SYS_MMAN_H
-               us->data = mmap(0, statbuf.st_size, PROT_READ, MAP_SHARED, fd, 0);
+               us->data = mmap(0, us->datasize, PROT_READ, MAP_SHARED, fd, 0);
                if (us->data == MAP_FAILED)
                        us->data = NULL;
 #else