]> granicus.if.org Git - psmisc/commitdiff
pstree: Explictly cast ino_t to long int
authorCraig Small <csmall@enc.com.au>
Sat, 25 Mar 2017 00:23:43 +0000 (11:23 +1100)
committerCraig Small <csmall@enc.com.au>
Sat, 25 Mar 2017 00:23:43 +0000 (11:23 +1100)
kFreeBSD compilier complains about this while Linux does not.
Gave wformat warning during compile.

src/pstree.c

index 7574bd8a40b391a58a6d417743f900699ef10b0c..ce51d262a45fbb866ff23e137648a9aee086fc4d 100644 (file)
@@ -834,7 +834,7 @@ static void dump_by_namespace(struct ns_entry *root)
     char buff[14];
 
     for ( ; ptr; ptr = ptr->next) {
-        snprintf(buff, sizeof(buff), "[%li]\n", ptr->number);
+        snprintf(buff, sizeof(buff), "[%li]\n", (long int)ptr->number);
         out_string(buff);
         for (c = ptr->children; c; c = c->next)
             dump_tree(c->child, 0, 1, 1, 1, 0, 0);