Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/sys Don't compare int against size_t .. since mbuf lengt...



details:   https://anonhg.NetBSD.org/src/rev/1779b2eb7478
branches:  trunk
changeset: 959471:1779b2eb7478
user:      kre <kre%NetBSD.org@localhost>
date:      Mon Feb 15 09:29:56 2021 +0000

description:
Don't compare int against size_t .. since mbuf lengths should never
be negative, cast it from int to size_t (rather than the other way
around).   Hopefully fix build.

diffstat:

 sys/sys/mbuf.h |  4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diffs (18 lines):

diff -r 72ace7198e61 -r 1779b2eb7478 sys/sys/mbuf.h
--- a/sys/sys/mbuf.h    Mon Feb 15 07:58:19 2021 +0000
+++ b/sys/sys/mbuf.h    Mon Feb 15 09:29:56 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: mbuf.h,v 1.229 2021/02/15 00:44:09 christos Exp $      */
+/*     $NetBSD: mbuf.h,v 1.230 2021/02/15 09:29:56 kre Exp $   */
 
 /*
  * Copyright (c) 1996, 1997, 1999, 2001, 2007 The NetBSD Foundation, Inc.
@@ -849,7 +849,7 @@
        if (POINTER_ALIGNED_P(mtod(*m, void *), align) == 0)
                *m = m_copyup(*m, hlen, 
                      linkhdr ? (max_linkhdr + align) & ~align : 0);
-       else if (__predict_false((*m)->m_len < hlen))
+       else if (__predict_false((size_t)(*m)->m_len < hlen))
                *m = m_pullup(*m, hlen);
        return *m == NULL;
 }



Home | Main Index | Thread Index | Old Index