commit 87295e3641fd4f47c78cbf982106f5df37fd706c from: smytht via: GitHub date: Wed Aug 09 08:54:55 2023 UTC Update stats.c to fix format types due to changes in 7.3+ current Peer reviewed by Stefan@ On Sun, Aug 06, 2023 at 09:25:23PM +0100, Tom Smyth wrote: > Does the following diff make sense ... ti does get rid of the compiler > warnings.. but I wanted to be certain... > > tobsd# diff nsh1.2.4/nsh/stats.c nsh1.2.2/nsh/stats.c > 855c855 > < printf("\t\t%u mbuf%s allocated to %s\n", > --- > > printf("\t\t%ld mbuf%s allocated to %s\n", > 863c863 > < printf("\t\t%u mbuf%s allocated to \n", > --- > > printf("\t\t%ld mbuf%s allocated to \n" These %u should be changed to %lu, not %ld. Then this fix is OK. The same %u -> %lu change was made in yasuoka's diff for OpenBSD netstat: https://gothub.org/?action=diff&commit=032e1cec45baf26f9fcab0835526606daebe822f&headref=HEAD&path=src.git commit - 41499e1536a5972223b1e902fad04b7f5f451935 commit + 87295e3641fd4f47c78cbf982106f5df37fd706c blob - d339af083a825dd6016a0ddb1fcef2490bde9843 blob + 982104664ea1a3714e2882c16a35aa971066e1a9 --- stats.c +++ stats.c @@ -852,7 +852,7 @@ mbpr(void) for (mp = mbtypes; mp->mt_name; mp++) if (mbstat.m_mtypes[mp->mt_type]) { seen[mp->mt_type] = YES; - printf("\t\t%u mbuf%s allocated to %s\n", + printf("\t\t%lu mbuf%s allocated to %s\n", mbstat.m_mtypes[mp->mt_type], plural((int)mbstat.m_mtypes[mp->mt_type]), mp->mt_name); @@ -860,7 +860,7 @@ mbpr(void) seen[MT_FREE] = YES; for (i = 0; i < nmbtypes; i++) if (!seen[i] && mbstat.m_mtypes[i]) { - printf("\t\t%u mbuf%s allocated to \n", + printf("\t\t%lu mbuf%s allocated to \n", mbstat.m_mtypes[i], plural((int)mbstat.m_mtypes[i]), i); }