diff --git a/src/netif/ppp/ppp.c b/src/netif/ppp/ppp.c index bb7e7add..097c7376 100644 --- a/src/netif/ppp/ppp.c +++ b/src/netif/ppp/ppp.c @@ -1318,7 +1318,7 @@ ppp_ioctl(ppp_pcb *pcb, int cmd, void *arg) case PPPCTLS_ERRCODE: /* Set the PPP error code. */ if (arg) { - pcb->err_code = *(u8_t *)arg; + pcb->err_code = (u8_t)(*(int *)arg); return PPPERR_NONE; } return PPPERR_PARAM;