From: Matthew Fernandez Date: Thu, 28 Jul 2022 02:11:31 +0000 (-0700) Subject: gvpr freadFile: squash a -Wsign-compare warning X-Git-Tag: 5.0.1~25^2~3 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ce7c9aca573b8a0affb7d87c491c57b9bfa87710;p=graphviz gvpr freadFile: squash a -Wsign-compare warning --- diff --git a/lib/gvpr/actions.c b/lib/gvpr/actions.c index c71508344..0839e2052 100644 --- a/lib/gvpr/actions.c +++ b/lib/gvpr/actions.c @@ -656,7 +656,8 @@ Agraph_t *freadFile(Expr_t * ex, int fd) { Sfio_t *sp; - if (fd < 0 || fd >= elementsof(ex->file) + if (fd < 0 || + (elementsof(ex->file) <= INT_MAX && fd >= (int)elementsof(ex->file)) || !((sp = ex->file[fd]))) { exerror("freadG: %d: invalid descriptor", fd); return 0;