]> git.draconx.ca Git - cdecl99.git/blobdiff - src/explain.c
Minor portability improvements.
[cdecl99.git] / src / explain.c
index 0f6b787afcb135122187322b668eb6f35813aa37..0d9c95740ca03ece599a610c881db74ccdcc540e 100644 (file)
@@ -20,6 +20,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <stdarg.h>
+#include <inttypes.h>
 #include <stdbool.h>
 #include <assert.h>
 
@@ -80,7 +81,7 @@ explain_array(char *buf, size_t n, struct cdecl_array *a)
                rc = snprintf(buf, n, "%s", a->vla);
                ret += cdecl__advance(&buf, &n, rc);
        } else if (a->length) {
-               rc = snprintf(buf, n, "%ju", a->length);
+               rc = snprintf(buf, n, "%" PRIuMAX, a->length);
                ret += cdecl__advance(&buf, &n, rc);
        }