]> granicus.if.org Git - graphviz/commitdiff
Xlib plugin: squash -Wsign-conversion warnings when setting 'normalhints'
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Sat, 5 Mar 2022 18:38:44 +0000 (10:38 -0800)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Sun, 6 Mar 2022 05:28:32 +0000 (21:28 -0800)
plugin/xlib/gvdevice_xlib.c

index 9126b595433b147d94c0e50428647d31c994d67e..79fd89814a0cf04ca9cf8f461fdfafe311ca9593 100644 (file)
@@ -11,6 +11,7 @@
 #include "config.h"
 
 #include <assert.h>
+#include <limits.h>
 #include <stdbool.h>
 #include <stdio.h>
 #include <stdlib.h>
@@ -325,7 +326,9 @@ static void init_window(GVJ_t *job, Display *dpy, int scr)
     normalhints->flags = 0;
     normalhints->x = 0;
     normalhints->y = 0;
+    assert(job->width <= (unsigned)INT_MAX && "out of range width");
     normalhints->width = job->width;
+    assert(job->height <= (unsigned)INT_MAX && "out of range height");
     normalhints->height = job->height;
 
     classhint = XAllocClassHint();