]> granicus.if.org Git - graphviz/commitdiff
Remove 2 -Wsign-conversion warnings in attr.c
authorMagnus Jacobsson <magnus.jacobsson@berotec.se>
Tue, 1 Sep 2020 06:36:15 +0000 (08:36 +0200)
committerMagnus Jacobsson <magnus.jacobsson@berotec.se>
Mon, 7 Sep 2020 13:42:17 +0000 (15:42 +0200)
lib/cgraph/attr.c

index 2dde01cafdfd82a5470228645b646ed13c99dee1..7094093f0aca58bfacde5fb8cffc8ddc66ead7b2 100644 (file)
@@ -245,9 +245,9 @@ static void addattr(Agraph_t * g, Agobj_t * obj, Agsym_t * sym)
     if (sym->id >= MINATTR)
        attr->str = (char **) AGDISC(g, mem)->resize(AGCLOS(g, mem),
                                                     attr->str,
-                                                    sym->id *
+                                                    (size_t) sym->id *
                                                     sizeof(char *),
-                                                    (sym->id +
+                                                    ((size_t) sym->id +
                                                      1) * sizeof(char *));
     attr->str[sym->id] = agstrdup(g, sym->defval);
     /* agmethod_upd(g,obj,sym);  JCE and GN didn't like this. */