]> granicus.if.org Git - graphviz/commitdiff
font_in_list_permissive: squash -Wsign-conversion warning
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Tue, 9 Nov 2021 02:45:41 +0000 (18:45 -0800)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Sun, 14 Nov 2021 21:59:18 +0000 (13:59 -0800)
The preceding logic guarantees this value will be non-negative.

lib/common/textspan_lut.c

index 9ad9cf6dd7197077c38ddc62c77c75c718fbbf01..77977576fb716f1a2b355dd4e60a5c1fc80392cf 100644 (file)
@@ -745,7 +745,8 @@ static bool font_in_list_permissive(const char *value, const char *list) {
 
   do {
     const char *next_pipe = strchr(list, '|');
-    size_t next_pipe_or_end_pos = next_pipe ? next_pipe - list : strlen(list);
+    size_t next_pipe_or_end_pos =
+        next_pipe ? (size_t)(next_pipe - list) : strlen(list);
     if (font_name_equal_permissive(value, list, next_pipe_or_end_pos)) {
       return true;
     }