]> granicus.if.org Git - graphviz/commitdiff
Ghostscript plugin gs_writer: squash -Wsign-conversion warnings
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Sun, 3 Apr 2022 20:04:57 +0000 (13:04 -0700)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Thu, 7 Apr 2022 13:46:40 +0000 (06:46 -0700)
plugin/gs/gvloadimage_gs.c

index c571c6e907d7c369b722d670b3018fd4211a3236..b13a1314565897140e9bcc2098a0211285075454 100644 (file)
@@ -9,7 +9,7 @@
  *************************************************************************/
 
 #include "config.h"
-
+#include <assert.h>
 #include <stdbool.h>
 #include <stdlib.h>
 #include <stdint.h>
@@ -64,8 +64,10 @@ static int gs_writer(void *caller_handle, const char *str, int len)
 {
     GVJ_t *job = caller_handle;
 
-    if (job->common->verbose)
-       return fwrite(str, 1, len, stderr);
+    if (job->common->verbose) {
+        assert(len >= 0);
+        return (int)fwrite(str, 1, (size_t)len, stderr);
+    }
     return len;
 }