]> granicus.if.org Git - graphviz/commitdiff
xdot parseXDotFOn: squash -Wsign-compare warning
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Wed, 10 Aug 2022 00:44:27 +0000 (17:44 -0700)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Wed, 10 Aug 2022 15:47:29 +0000 (08:47 -0700)
lib/xdot/xdot.c

index 865386df7ad4a67227a542ebaeb29c420611fdc8..86058332d6fcbbad08d56a94eb0b584695f40723 100644 (file)
@@ -341,7 +341,7 @@ xdot *parseXDotFOn (char *s, drawfunc_t fns[], int sz, xdot* x)
 
     if (!x) {
        x = gv_alloc(sizeof(*x));
-       if (sz <= sizeof(xdot_op))
+       if (sz < 0 || (size_t)sz <= sizeof(xdot_op))
            sz = sizeof(xdot_op);
 
        /* cnt, freefunc, ops, flags zeroed by gv_alloc */