Commit Diff
- Commit:
87295e3641fd4f47c78cbf982106f5df37fd706c
- From:
- smytht <smytht@users.noreply.github.com>
- Via:
- GitHub <noreply@github.com>
- Date:
- Message:
- 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 <mbuf type %d>\n", > --- > > printf("\t\t%ld mbuf%s allocated to <mbuf type %d>\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
- Actions:
- Patch | Tree
--- 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 <mbuf type %d>\n", + printf("\t\t%lu mbuf%s allocated to <mbuf type %d>\n", mbstat.m_mtypes[i], plural((int)mbstat.m_mtypes[i]), i); }