From 678a7a40448226c4e9d391e352dce0c76e671675 Mon Sep 17 00:00:00 2001 From: Sylvain Rochet Date: Fri, 16 Oct 2020 17:17:40 +0200 Subject: [PATCH] PPP, PPPoE: remove casts from unsigned (strlen return value) to signed Those casts do not serve any purpose and can be safely removed. --- src/netif/ppp/pppoe.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/netif/ppp/pppoe.c b/src/netif/ppp/pppoe.c index 6e90c869..229fe461 100644 --- a/src/netif/ppp/pppoe.c +++ b/src/netif/ppp/pppoe.c @@ -753,20 +753,20 @@ pppoe_send_padi(struct pppoe_softc *sc) { struct pbuf *pb; u8_t *p; - int len; + size_t len; #if PPPOE_SCNAME_SUPPORT - int l1 = 0, l2 = 0; /* XXX: gcc */ + size_t l1 = 0, l2 = 0; /* XXX: gcc */ #endif /* PPPOE_SCNAME_SUPPORT */ /* calculate length of frame (excluding ethernet header + pppoe header) */ len = 2 + 2 + 2 + 2 + sizeof sc; /* service name tag is required, host unique is send too */ #if PPPOE_SCNAME_SUPPORT if (sc->sc_service_name != NULL) { - l1 = (int)strlen(sc->sc_service_name); + l1 = strlen(sc->sc_service_name); len += l1; } if (sc->sc_concentrator_name != NULL) { - l2 = (int)strlen(sc->sc_concentrator_name); + l2 = strlen(sc->sc_concentrator_name); len += 2 + 2 + l2; } #endif /* PPPOE_SCNAME_SUPPORT */