]> granicus.if.org Git - graphviz/commitdiff
fix printf format code in agnameof()
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Sat, 24 Oct 2020 17:28:38 +0000 (10:28 -0700)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Sat, 31 Oct 2020 01:46:51 +0000 (18:46 -0700)
This fixes a build warning on macOS when using CMake. Related to !1620.

lib/cgraph/id.c

index 96aaa912c3f41bcfb7e620e1df2255fa4c293236..6b7a4822c7e575ce09992929a54b761eddd04c7c 100644 (file)
@@ -13,6 +13,7 @@
 
 #include <stdio.h>
 #include <cgraph/cghdr.h>
+#include <inttypes.h>
 
 /* a default ID allocator that works off the shared string lib */
 
@@ -152,7 +153,7 @@ char *agnameof(void *obj)
     }
     if (AGTYPE(obj) != AGEDGE) {
        static char buf[32];
-       snprintf(buf, sizeof(buf), "%c%ld", LOCALNAMEPREFIX, AGID(obj));
+       snprintf(buf, sizeof(buf), "%c%" PRIu64, LOCALNAMEPREFIX, AGID(obj));
        rv = buf;
     }
     else